2つのモジュール(child1、child2)を持つマルチモジュールプロジェクトを作成しました。
私はパッケージを作成しようとしています--App.properties、child1.war、child2.warを含むべきAPP.zipはアセンブリプラグインを使用しています。私はMVNアセンブリを実行すると
は、しかし、私は以下のエラーを取得しています:シングルコマンドマルチモジュールプロジェクトでアセンブリアーカイブを作成できません
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-assembly-plugin:2.6:single (default-cli) on project app: Failed to create assembly: Error creating assembly archive My_Package: You must set at least one file. -> [Help 1]
プロジェクトのフォルダ構造
app
|
pom.xml
assembly.xml
app.properties
child 1
|
pom.xml src target
|
child1.war
child 2
|
pom.xml src target
|
child2.war
親ポンポン(アプリ/のpom.xml)
<project>
<groupId>com.karthik</groupId>
<artifactId>parent</artifactId>
<packaging>pom</packaging>
<version>1.0-SNAPSHOT</version>
<name>parent</name>
<modules>
<module>child 1</module>
<module>child 2</module>
</modules>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<finalName>APP</finalName>
<appendAssemblyId>false</appendAssemblyId>
<descriptors>
<descriptor>assembly.xml</descriptor>
</descriptors>
</configuration>
<executions>
<execution>
<id>make-bundles</id>
<goals>
<goal>single</goal>
</goals>
<phase>package</phase>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>
assembly.xml
<assembly
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
<formats>
<format>zip</format>
</formats>
<id>My_Package</id>
<includeBaseDirectory>false</includeBaseDirectory>
<moduleSets>
<moduleSet>
<useAllReactorProjects>true</useAllReactorProjects>
<includes>
<include>com.karthik:child1</include>
<include>com.karthik:child2</include>
</includes>
</moduleSet>
</moduleSets>
</assembly>
私はこのエラーの原因となっているアセンブリ記述子で何かが間違っていると思います。
1)この問題を解決するにはどうすればよいですか& app.properties、child1.war、child2.warを含むzip(APP.zip)の作成を支援しますか?
2)いつ使用する必要がありますか<fileSet>
& <moduleSet>
タグ?
お返事ありがとうございます。しかし、mvn packageコマンドを実行してもアセンブリは作成されません。また、バイナリセクションの出力ディレクトリの値はどうでしょうか? – Karthik
また、assembly.xmlにmoduleSetを保持しています。配布モジュールのassembly.xmlは、他のモジュール - 子1と子2を見つけることができますか? – Karthik
私は実例への答えを変えました。 –