2

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

[错误] 无法执行目标 org.apache.maven.plugins:maven-assembly-plugin:2.3: single (assembly:package) on project business-serviceability-ear: 无法创建程序集:创建程序集存档 bin 时出错:无法创建程序集配置归档器: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 中的什么地方吗?我必须放一些,否则我会收到此错误:

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

谢谢你,维克托

4

1 回答 1

1

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

    <formats>
<!--        <format>dir</format> -->
<!--        <format>war</format> -->
        <format>ear</format>
    </formats>
于 2012-05-28T15:46:07.557 回答