Maven2 程序集插件 - 更改 tar.gz 的根名称

发布于 09-05 02:00 字数 123 浏览 11 评论 0原文

我正在使用程序集插件来 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

轻许诺言2024-09-12 02:00:58

我最近也有同样的要求。根据使用备用程序集基目录<部分/em> 在文档中,您可以将以下指令添加到程序集 XML 文件中:

<baseDirectory>${artifactId}</baseDirectory>

这对我有用。需要 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:

<baseDirectory>${artifactId}</baseDirectory>

which worked for me. Requires Maven assembly 2.2+.

聊慰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>

I known this is an old topic but since I've got the same problem.

You can change the name of the root directory by filling the "finalName" property of your assembly plug-in in your pom.xml.

       <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>
歌入人心2024-09-12 02:00:58

在项目的 pom.xml 中,在配置程序集插件时尝试使用“outputDirectory”属性。例如:

<plugin>
  <artifactId>maven-assembly-plugin</artifactId>
  <configuration>
    <outputDirectory>some/path</outputDirectory>
......
  </configuration>
<plugin>

In pom.xml of your project, while configuring your assembly plug-in try to use "outputDirectory" property. For inst.:

<plugin>
  <artifactId>maven-assembly-plugin</artifactId>
  <configuration>
    <outputDirectory>some/path</outputDirectory>
......
  </configuration>
<plugin>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文