Maven2 程序集插件 - 更改 tar.gz 的根名称
我正在使用程序集插件来 tar.gz 包。我试图将根输出目录从 ${project.name}-{$project.version} 更改为 ${project.name},但似乎无法在任何地方找到该配置选项。有人知道这是否可能吗?
I am using the assembly plugin to tar.gz up a package. I am trying to change the root output directory from ${project.name}-{$project.version} to just ${project.name}, but cant seem to find the configuration option for that anywhere. Anyone know if this is possible?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

发布评论
评论(3)
聊慰2024-09-12 02:00:58
我知道这是一个老话题,但因为我也遇到了同样的问题。
您可以通过在 pom.xml 中填写程序集插件的“finalName”属性来更改根目录的名称。
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<finalName>test</finalName>
<descriptors>
<descriptor>src/assembly/assembly.xml</descriptor>
</descriptors>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
~没有更多了~
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
我最近也有同样的要求。根据使用备用程序集基目录<部分/em> 在文档中,您可以将以下指令添加到程序集 XML 文件中:
这对我有用。需要 Maven 程序集 2.2+。
I recently had the same requirement. According to section Using an Alternative Assembly Base Directory in the docs, you can add the following directive to your assembly XML file:
which worked for me. Requires Maven assembly 2.2+.