I have a package plugins
and there are some java sources:
plugins - | - Plugin1.java
| - Plugin2.java
| - ............
| - PluginN.java
I need to compile every plugin in jar file. I want to end up with plugin1.jar, plugin2.jar and so on. Is is possible to do with maven-assembly plugin or maven-jar? Or I need to develop my own maven plugin?
You can do that with maven-jar-plugin
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<id>make-plugin1-jar</id>
<phase>prepare-package</phase>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<includes>
<include>com/myapp/plugins/Plugin1.class</include>
</includes>
<finalName>plugin1.jar</finalName>
</configuration>
</execution>
<execution>
<id>make-plugin2-jar</id>
<goals>
<goal>jar</goal>
</goals>
<phase>prepare-package</phase>
<configuration>
<includes>
<include>com/myapp/plugins/Plugin2.class</include>
</includes>
<finalName>plugin2.jar</finalName>
</configuration>
</execution>
</executions>
</plugin>
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.