Quantcast
Channel: DevOps tips & tricks
Viewing all articles
Browse latest Browse all 181

Maven JAR plugin - include/exclude classes, create additional JARs from module

$
0
0

 HOWTO

Plugin configuration

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.3.0</version>
<configuration>
<includes>
<include>**/generics/*</include>
</includes>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<classifier>test-ldap</classifier>
<includes>
<include>**/ldap/*</include>
</includes>
</configuration>
</execution>
</executions>
</plugin>

JARs created

[INFO] --- maven-jar-plugin:3.3.0:jar (default-jar) @ tutorial ---
[INFO] Building jar: /git/java-tutorial/target/tutorial.jar
[INFO]
[INFO] --- maven-jar-plugin:3.3.0:jar (default) @ tutorial ---
[INFO] Building jar: /git/java-tutorial/target/tutorial-test-ldap.jar


Viewing all articles
Browse latest Browse all 181

Trending Articles