How to Stop Renaming Maven Installed Cans

I install my internal files in the Maven repository using the mvn install: install command. All Jars installed this way have a version name added automatically as a suffix. Since we have many scripts with the names Jars, this is very inconvenient for us. How can this automatic rename be disabled?

+3
source share
2 answers

You can not. Dependency resolution in Maven works because Maven has conventions, and one of them is naming artifacts. Therefore, you cannot disable maven artifacts install(and you really don't want to).

A common way to process scripts (bat / sh) is to place them in the source tree (for example, in src/main/bin) and create a distribution kit for your project using the plugin builder . When creating an assembly, you can rename artifacts, filter distribution files, etc. That would be the right place for such things.

+7
source

It is tempting to want to remove the version number, but I would recommend keeping it, if at all possible.

, , , Maven ? Maven , , ${project.version} bat script pom.xml. , , script () .

, maven , , , Maven , , imo. , java, maven - jar lib. , - .

, maven, 100% ( , ).

+3

Source: https://habr.com/ru/post/1735070/


All Articles