modulesプロジェクト。Maven - jarファイルを圧縮する簡単なプラグイン
-1
-pom.xml
-2
-pom.xml
-3
-pom.xml
-parent
-pom.xml
であり、すべてのモジュールが親のpomによって継承されます。私は親のポンポンを編集しているかしていると私は2瓶(-1から-2)
とジッパーを構築するためのプラグインを作成したい私はその
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.7</version>
<executions>
<execution> <id>createDistJar</id>
<goals> <goal>run</goal> </goals> <phase>package</phase>
<configuration>
<target>
<echo message="${project.build.directory}"/>
<mkdir dir="${project.build.directory}"/>
<zip destfile="${project.build.directory}/JawaBot-${project.version}-dist.zip"
basedir="target/" includes="JawaBot-${project.version}-dist-rh/**">
</zip>
</target>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.8</version>
<executions>
<execution>
<id>uploadDistJar</id> <goals> <goal>attach-artifact</goal> </goals>
<phase>package</phase>
<configuration>
<artifacts>
<artifact>
<file>${project.build.directory}/JawaBot-${project.version}-dist.zip</file>
<type>zip</type>
</artifact>
</artifacts>
</configuration>
</execution>
</executions>
</plugin>
のようなものを試してみましたが、それはzipファイルをcretesすべての/より大きなフォルダ内のすべてのモジュールに対して。
[Mavenアセンブリプラグイン] (http://maven.apache.org/plugins/maven-assembly-plugin/)が問題の解決策になるかもしれません。 – superbob
私は例を教えてくれますか? –
khmarbaiseは私より速かった。彼の答えは良いです。 – superbob