Maven2:在包阶段重命名提供的依赖项?

发布于 2024-09-04 08:29:32 字数 522 浏览 2 评论 0原文

我有一个耳朵工件,其POM

中的构建定义中有一个 FinalName 标签。

<artifactId>application-app</artifactId>
...
<build>
 <finalName>application</finalName>

这导致我在构建时将工件 application-app 作为文件 application.ear 获得。由于与其他解决方案的一些大量遗留集成,ear 文件的命名很重要。

问题是我们有几个特定的​​构建项目,它们都包含这个 Ear 作为提供的依赖项。由于实际的工件名称是 application-app,因此它显示为 application-app.ear ->运行时崩溃。

将工件 ID 从 application-app 更改为 application 不是一个选项。

您是否知道一种在提供的依赖项上实现类似 FinalName 的操作的方法(我猜是在包阶段......)?

Greetings

I have an ear artifact with a finalName tag in its build definition in the POM.

<artifactId>application-app</artifactId>
...
<build>
 <finalName>application</finalName>

This results in me getting the artifact application-app as the file application.ear when building. It is important that the ear file is named like this due to some heavy legacy integration with other solutions.

The problem is that we have several specific build projects, which all include this ear as a provided dependency. Since the actual artifact name is application-app it comes out as application-app.ear -> runtime crash.

Changing the artifact ID from application-app to application is not an option.

Do you know of a way to implement a finalName like operation on provided dependecies (I guess in the package phase...)?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

冰雪梦之恋 2024-09-11 08:29:32

尝试配置 Maven EAR 插件

<project>
  ...
  <build>
    ...
    <plugins>
      ...
      <plugin>
        <artifactId>maven-ear-plugin</artifactId>
        <version>2.4</version>
        <configuration>
          <finalName>application</finalName>
        </configuration>
      </plugin>
      ...
</project>

Try configuring the Maven EAR plugin:

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