我正在使用maven assembly插件构建一个项目。但这一过程失败,出现以下错误,(在这里我粘贴在詹金斯的错误。我不詹金斯检查过。)一个zip文件不能包含它本身 - Maven-assembly插件
[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。 –
是的,那是什么发生。任何想法如何使用配置来解决它 – Charls
请更新到maven-assembly-plugin(2.4)的最新版本,而不是真正的旧版本。此外请显示您的完整POM文件。 – khmarbaise