Maven 预定义的“bin”装配不工作?
我有一个项目,它使用 maven-assemble-plugin 创建源文件和二进制 tar 和 zip 文件以供下载。但是,每当我尝试构建 bin 程序集时,它都会失败并显示错误“tar 文件不能包含自身”。
我可以通过使用 maven-archetype-plugin 创建的最小 Maven 项目重现此问题,并将以下内容添加到 pom.xml:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.2</version>
<configuration>
<descriptorRefs>
<descriptorRef>src</descriptorRef>
<descriptorRef>bin</descriptorRef>
</descriptorRefs>
<outputDirectory>${project.build.directory}/site/downloads</outputDirectory>
</configuration>
<executions>
<execution>
<phase>site</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
有了此插件声明,如果我执行“mvn site”,我会收到上述错误消息或“mvn 程序集:程序集”。
有谁知道为什么这不起作用?
我很乐意提供帮助诊断问题所需的任何其他信息。
I have a project that uses the maven-assembly-plugin to create source and binary tar and zip files for download. However, whenever I try to build the bin assembly it fails with an error that says "A tar file cannot include itself."
I can reproduce this problem with a minimal Maven project created with the maven-archetype-plugin and adding the following to the pom.xml:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.2</version>
<configuration>
<descriptorRefs>
<descriptorRef>src</descriptorRef>
<descriptorRef>bin</descriptorRef>
</descriptorRefs>
<outputDirectory>${project.build.directory}/site/downloads</outputDirectory>
</configuration>
<executions>
<execution>
<phase>site</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
With this plugin declaration in place I get the above-mentioned error message if I execute either "mvn site" or "mvn assembly:assembly".
Does anyone have any idea why this isn't working?
I'd be happy to provide any other information needed to help diagnose the problem.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Maven 程序集插件 2.2 版似乎有问题,您的代码片段适用于该插件的 2.1 版。
我没有检查 Jira 是否存在现有问题。如果找不到,最好养一个新的。
It looks like there is a problem with version 2.2 of the Maven Assembly Plugin, your snippet works with the version 2.1 of the plugin.
I didn't check Jira for an existing issue. If you can't find any, it would be nice to raise a new one.