Created
August 17, 2011 09:55
-
-
Save olamy/1151235 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
How to create a jar containing test classes | |
You can produce a jar which will include your test classes and resources. | |
<project> | |
... | |
<build> | |
<plugins> | |
... | |
<plugin> | |
<groupId>org.apache.maven.plugins</groupId> | |
<artifactId>maven-jar-plugin</artifactId> | |
<version>2.4-SNAPSHOT</version> | |
<executions> | |
<execution> | |
<goals> | |
<goal>test-jar</goal> | |
</goals> | |
</execution> | |
</executions> | |
</plugin> | |
... | |
</plugins> | |
</build> | |
... | |
</project> | |
To reuse this artifact in an other project, you must declare this dependency with classifier test-jar : | |
<project> | |
... | |
<dependencies> | |
<dependency> | |
<groupId>groupId</groupId> | |
<artifactId>artifactId</artifactId> | |
<type>test-jar</type> | |
<version>version</version> | |
</dependency> | |
</dependencies> | |
... | |
</project> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment