【发布时间】:2014-03-14 05:36:46
【问题描述】:
我正在使用 maven 程序集插件构建一个项目。但是该过程失败并出现以下错误,(这里我将错误粘贴在jenkins中。我也检查了没有jenkins。)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2:29.792s
[INFO] Finished at: Fri Mar 14 10:26:58 IST 2014
[INFO] Final Memory: 26M/75M
[INFO] ------------------------------------------------------------------------
Waiting for Jenkins to finish collecting data
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-assembly-plugin:2.2-beta-5:assembly (default) on project ExecutionBot: Failed to create assembly: Error creating assembly archive jar-with-dependencies: A zip file cannot include itself -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
pom.xml 中的配置
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>assembly</goal>
</goals>
<phase>package</phase>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<archive>
<manifest>
<mainClass>com.starter.MyListner</mainClass>
</manifest>
</archive>
</configuration>
</execution>
</executions>
</plugin>
【问题讨论】:
-
也许您正在尝试将创建的 zip 文件保存在文件夹中,您在该文件夹中迭代文件并添加到 zip。
-
是的,这就是发生了什么。知道如何通过配置解决它
-
请更新到最新版本的 maven-assembly-plugin (2.4) 而不是真正的旧版本。此外,请出示您的完整 pom 文件。
-
谢谢兄弟。是的,概率与版本有关。无论如何都解决了。我把它放在下面
标签: maven maven-plugin maven-assembly-plugin