使用Maven程序集插件创建EAR [英] create an EAR with maven assembly plugin
问题描述
我尝试使用maven程序集插件创建EAR,但收到错误消息,而不是EAR文件...
I try to create an EAR with the maven assembly plugin but I got an error message instead of EAR file...
[错误]无法执行目标org.apache.maven.plugins:maven-assembly-plugin:2.3: 项目business-serviceability-ear上的单个(程序集:程序包):创建程序集失败: 创建程序集归档文件bin时出错:无法配置归档程序:org.codehaus.plexus.archiver.dir.DirectoryArchiver: 在'appxml'-> [帮助1]
[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有趣的部分:
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>
能帮我在pom.xml中放置元素的地方吗? 我必须放一些东西,否则会出现此错误:
Could you please help where I should put the element in the pom.xml? I have to put somehwere otherwise I get this error:
[错误]在项目business-serviceability-ear上执行目标org.apache.maven.plugins:maven-assembly-plugin:2.3:single(assembly:package)失败:失败 ed创建程序集:创建程序集存档bin时出错:需要appxml属性-> [帮助1]
[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]
谢谢你, 维克多
推荐答案
对不起,我在bin.xml中犯了一个错误. 我定义了更多的格式元素,而不仅仅是一个...这是可行的解决方案.
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>
这篇关于使用Maven程序集插件创建EAR的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!