问题
I try to create an EAR with the maven assembly plugin but I got an error message instead of EAR file...
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-assembly-plugin:2.3: single (assembly:package) on project business-serviceability-ear: Failed to create assembly: Error creating assembly archive bin: Failed to configure archiver: org.codehaus.plexus.archiver.dir.DirectoryArchiver: Cannot find setter, adder nor field in org.codehaus.plexus.archiver.dir.DirectoryArchiver for 'appxml' -> [Help 1]
The interesting part of my pom.xml:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.3</version>
<executions>
<execution>
<id>assembly:package</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<archiverConfig>
<appxml>src/main/resources/META-INF/application.xml</appxml>
</archiverConfig>
<descriptors>
<descriptor>src/main/assembly/bin.xml</descriptor>
</descriptors>
</configuration>
</execution>
</executions>
Could you please help where I should put the element in the pom.xml? I have to put somehwere otherwise I get this error:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-assembly-plugin:2.3:single (assembly:package) on project business-serviceability-ear: Fail ed to create assembly: Error creating assembly archive bin: appxml attribute is required -> [Help 1]
Thank you, Viktor
回答1:
Sorry, I made a mistake in the bin.xml. I defined more format element not just one... this is the working solution.
<formats>
<!-- <format>dir</format> -->
<!-- <format>war</format> -->
<format>ear</format>
</formats>
来源:https://stackoverflow.com/questions/10787010/create-an-ear-with-maven-assembly-plugin