arturobernalg opened a new pull request, #3601: URL: https://github.com/apache/maven-surefire/pull/3601
…tom excludes getExcludeList(true) only fell back to the default "**/*$*" exclude (which keeps nested/inner classes out of the test-class scan) when the user hadn't configured any excludes at all. As soon as a project set any <excludes>/<excludesFile> entry, the default was dropped entirely, so a @Nested JUnit 5 class whose simple name happens to match one of the default include patterns (e.g. ending in "Tests") got scanned in and run as a bogus standalone top-level test. Nested classes are never meant to be separate scan targets - they run as part of their enclosing class - so the default exclude now merges with whatever excludes the user supplied instead of being replaced by them. Also fixes the applies-to-both plugins since maven-failsafe's IntegrationTestMojo shares this code via AbstractSurefireMojo, and corrects the parameter Javadoc on both mojos, which described the old "only when nothing else is set" behavior. Claude-Session: https://claude.ai/code/session_01BrsHTdDq7PD1DoqeA9vs66 Fixes #2010. The maintainer (Tibor Digana) had already pointed at getDefaultExcludes() in the issue thread as the place to look. --- To make clear that you license your contribution under the [Apache License Version 2.0, January 2004](https://www.apache.org/licenses/LICENSE-2.0) check one of the following: - [x] I hereby declare this contribution to be licensed under the [Apache License Version 2.0, January 2004](https://www.apache.org/licenses/LICENSE-2.0) - [x] I hereby declare that I have filed an [Apache Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf). -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
