Created
July 11, 2019 12:38
-
-
Save alexstolr/b7f8f32dbceb202e97d7258794d019ec to your computer and use it in GitHub Desktop.
Sharing src/test classes between modules in a multi-module maven project
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
Add in base module pom (under dependencies for example): | |
<build> | |
<plugins> | |
<plugin> | |
<groupId>org.apache.maven.plugins</groupId> | |
<artifactId>maven-jar-plugin</artifactId> | |
<version>3.1.2</version> | |
<executions> | |
<execution> | |
<goals> | |
<goal>testutil-jar</goal> | |
</goals> | |
</execution> | |
</executions> | |
</plugin> | |
</plugins> | |
</build> | |
Add dependency in child module: | |
<dependency> | |
<groupId>com.example</groupId> | |
<artifactId>submodule</artifactId> | |
<version>1.0</version> | |
<type>testutil-jar</type> | |
<scope>test</scope> | |
</dependency> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment