读取Maven建筑中的装配时出错

时间:2016-01-21 10:58:03

标签: java maven

这是我的pom.xml文件以及构建

时出现的错误

错误:

  

无法执行目标org.apache.maven.plugins:maven-assembly-plugin:2.2-beta-5:单个(default-cli)项目load-xml-to-s3:读取程序集时出错:没有程序集描述符找到。

1; 2; 4; 5; 10; 11; 22; 23; 46

1 个答案:

答案 0 :(得分:2)

maven-assembly-plugin的{​​{3}}属性需要从项目的基本目录开始的路径。例如,如果文件位于src/assembly/distribution.xml内,则这是您应指定的路径。

您将插件绑定到的阶段也存在问题。阶段descriptors不存在,您应该使用<phase>package</phase>

作为一个副节点,您使用的是旧版本的插件(2.2-beta-5)。请考虑使用最新版本,即assembly

示例配置:

<plugin>
    <!-- no need to specify the groupId, it defaults to "org.apache.maven.plugins" -->
    <artifactId>maven-assembly-plugin</artifactId>
    <version>2.6</version> <!-- explicit version is safer for build consistency than implicit -->
    <executions>
        <execution>
            <id>make-assembly</id>
            <phase>package</phase> <!-- bind the execution to the "package" phase -->
            <goals>
                <goal>single</goal>
            </goals>
            <configuration>
                <descriptors>
                    <descriptor>src/assembly/distribution.xml</descriptor> <!-- use the path to the file starting from base directory -->
                </descriptors>
            </configuration>
        </execution>
    </executions>
</plugin>

使用mvn clean install运行Maven将在包阶段正确调用插件。

相关问题