2012-05-28 90 views
2

我尝试创建使用Maven Assembly插件的EAR,但我得到一个错误信息,而不是EAR文件...创建与Maven Assembly插件的EAR

[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]

我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> 

能否请你帮忙,我应该把元素在pom.xml? 我必须把somehwere否则我得到这个错误:

[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]

谢谢 尤

+0

为什么你不使用maven-ear-plugin? – khmarbaise

回答

1

对不起,我在bin.xml犯了一个错误。 我定义了更多的格式元素,不只是一个......这是工作的解决方案。

<formats> 
<!--  <format>dir</format> --> 
<!--  <format>war</format> --> 
     <format>ear</format> 
    </formats>