How to build a WAR project in Maven giving a custo

2019-09-03 12:00发布

问题:

I know that, I can give a fileName for the WAR file using the build/finalName tag in the pom.xml file.

But this will only affect the name of the package created in the target directory (or a specifically given directory using build/directory). It will not affect to the file name in the local repository and remote repositories and they'll always contains the name with version numbers.

Is there any other way to do this as it will affect to the local repository and remote repositories as well?

References : how to Build project with maven without version

回答1:

Basically the artifact in the repository is identified by our pom.xml, the group-id and artifact-id. Even we change the finalName, there is no any effect, since our pom.xml still the same.

Imagine that our pom.xml is defined as some-group:foo. Then we change the finalName to bar I've no idea how can we get the some-group:bar from the repository.

There are no any pom.xml which describes about some-group:bar.