create an EAR with maven assembly plugin [closed]

拈花ヽ惹草 提交于 2020-01-05 03:03:25

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!