How can I force maven to leave the version number out of dependency file names?

混江龙づ霸主 提交于 2019-12-22 19:20:10

问题


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...).

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

<artifactId>-<version>.<type>

I'd like them to be named:

<artifactId>.<type>

Can someone point me in the right direction?


回答1:


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

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




回答2:


Set the finalName property. See http://maven.apache.org/plugins/maven-assembly-plugin/assembly-mojo.html for more details



来源:https://stackoverflow.com/questions/1709290/how-can-i-force-maven-to-leave-the-version-number-out-of-dependency-file-names

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!