如何停止Maven重命名已安装的jar [英] How to stop Maven renaming installed jars
问题描述
我正在使用mvn install:install命令将我们的内部文件安装到Maven存储库.以这种方式安装的所有Jar均会自动添加版本名称作为后缀.由于我们有许多带有Jars名称的批处理脚本,因此对我们来说非常不便.如何关闭自动重新命名?
I am installing to Maven repository our internal files using mvn install:install command. All Jars installed in such way have version name added automatically as a suffix. Since we have many batch scripts with the Jars names it is very inconvenient for us. How this auto-renaming can be switched off?
推荐答案
您不能. Maven中的依赖关系解析之所以有效,是因为Maven具有约定,而工件的命名就是其中之一.因此,您无法关闭Maven install
工件的方式(而且您实际上也不想这么做).
You can't. Dependency resolution in Maven works because Maven has conventions and the naming of artifacts is one of them. So you can't turn off the way maven install
artifacts (and you actually don't want to).
处理脚本(bat/sh)的常用方法是将它们放在源树中(例如,在src/main/bin
中),并使用组装插件.构建程序集时,可以重命名工件,
The common way to handle scripts (bat/sh) is to put them in your source tree (e.g. in src/main/bin
) and to create a distribution of your project with the assembly plugin. When building your assembly, you can rename artifacts, filter distribution files, etc. That would be the right place to do such kind of things.
这篇关于如何停止Maven重命名已安装的jar的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!