How to configure pom to run tests packaged in a jar?

前端 未结 3 1514
梦谈多话
梦谈多话 2021-01-01 16:57

I have a maven build process that publishes executable jars and their tests to Nexus. I have another maven build process that needs to access these jars (executable + test)

3条回答
  •  离开以前
    2021-01-01 17:36

    This actually works quite fine with the newer surefire and failsafe plugins, see related questions:

    • Run JUnit Tests contained in dependency jar using Maven Surefire
    • run maven tests from classpath

    So you don't need to unpack the jar anymore, you just provide the group and artifact id for the dependencies to scan (this works with both "main jar" dependencies, as well as "test-jar" dependencies)

提交回复
热议问题