【问题标题】:create an EAR with maven assembly plugin [closed]使用 Maven 程序集插件创建 EAR [关闭]
【发布时间】:2012-05-28 15:25:42
【问题描述】:

我尝试使用 maven 程序集插件创建 EAR,但收到错误消息而不是 EAR 文件...

[错误] 无法执行目标 org.apache.maven.plugins:maven-assembly-plugin:2.3: 项目业务服务能力耳上的单个(组件:包):无法创建组件: 创建程序集存档箱时出错:无法配置存档器:org.codehaus.plexus.archiver.dir.DirectoryArchiver: 在 'appxml' 的 org.codehaus.plexus.archiver.dir.DirectoryArchiver 中找不到 setter、adder 或字段 -> [帮助 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 中的什么位置吗? 我必须放一些东西,否则我会收到这个错误:

[ERROR] 无法在项目 business-serviceability-ear 上执行目标 org.apache.maven.plugins:maven-assembly-plugin:2.3:single (assembly:package):失败 ed 创建程序集:创建程序集存档 bin 时出错:需要 appxml 属性 -> [帮助 1]

谢谢你, 维克托

【问题讨论】:

  • 你为什么不使用 maven-ear-plugin 代替?

标签: maven ear maven-assembly-plugin


【解决方案1】:

对不起,我在 bin.xml 中写错了。 我定义了更多的格式元素,而不仅仅是一个……这是可行的解决方案。

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-12-24
    • 1970-01-01
    • 2010-12-04
    • 2014-12-07
    • 1970-01-01
    • 2010-11-07
    相关资源
    最近更新 更多