如何强制Maven将版本号保留在依赖文件名之外? [英] How can I force maven to leave the version number out of dependency file names?

查看:146
本文介绍了如何强制Maven将版本号保留在依赖文件名之外?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用maven构建一个".ear"项目,该项目可以解决maven存储库中的依赖项,然后将它们打包到耳朵中(这可能是多余的句子...).

I'm using maven to build a ".ear" project that resolves dependencies from a maven repository, and then packages them into an ear (that's probably a redundant sentence...).

当依赖关系显示在ear文件中时,将按照以下格式命名它们:

When the dependencies show up in the ear file, they're named according to this format:

<artifactId>-<version>.<type>

我希望它们被命名为

<artifactId>.<type>

有人可以指出我正确的方向吗?

Can someone point me in the right direction?

推荐答案

如果您正在使用maven-assembly-plugin构建耳朵,则可以在描述符中使用outputFileNameMapping属性:

If you're using the maven-assembly-plugin to build your ear, you can use the outputFileNameMapping property in your descriptor: http://maven.apache.org/plugins/maven-assembly-plugin/assembly.html#class_dependencySet

但是,最好使用maven-ear-plugin,在这种情况下,您可以自定义bundleFileName,如

However, you're probably better off using the maven-ear-plugin, in which case you can customize the bundleFileName, as described here.

这篇关于如何强制Maven将版本号保留在依赖文件名之外?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆