Skip to content

Instantly share code, notes, and snippets.

@kevinhooke
Created September 4, 2025 09:00
Show Gist options
  • Select an option

  • Save kevinhooke/2b2cd53724b5ebc0fe6778c51d4df1c0 to your computer and use it in GitHub Desktop.

Select an option

Save kevinhooke/2b2cd53724b5ebc0fe6778c51d4df1c0 to your computer and use it in GitHub Desktop.
JUnit run specific test in a Maven submodule
mvn test -Dtest=package.testname -pl subprojectname -am -Dsurefire.failIfNoSpecifiedTests=false
// -pl module name containing test
// -am = also modules, to build dependent modules
// -Dsurefire.failIfNoSpecifiedTests=false = don't fail if dependent modules don't contain any tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment