Am 12/23/16 um 09:39 schrieb Dirk Olmes: > On 12/22/2016 03:43 PM, João Cabrita wrote: >> You can use the maven-jar-plugin's test-jar goal: >> https://maven.apache.org/plugins/maven-jar-plugin/test-jar-mojo.html >> >> That creates a second jar with the same coordinates but a 'test' classifier >> that you can add as a test scoped dependency on myproject-application. > > That's the approach I use here, too. > > Bear in mind that this test scoped jar does not have any dependencies. > So, if your test code uses e.g. commons-lang then just including the > test scoped dependency in another project is not enough - you'll have to > include commson-lang there, too. >
I'd move those re-useable test classes into theire own module. For the example mentioned above, you would add commons-lang as a compile dependency to that module and then you can depend on that module in test scope the usual way and you'll get the transitive dependencies onto the test classpath automatically. Regards, -- Christian --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
