问题描述
我知道,我可以使用pom.xml文件中的build/finalName标签为WAR文件指定一个文件名.
I know that, I can give a fileName for the WAR file using the build/finalName tag in the pom.xml file.
但这只会影响在目标目录(或使用build/directory专门指定的目录)中创建的软件包的名称.它不会影响本地存储库和远程存储库中的文件名,它们将始终包含带有版本号的名称.
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?
参考文献:如何使用不带版本的maven构建项目
推荐答案
repository
中的artifact
基本上由我们的pom.xml
,group-id
和artifact-id
标识.即使我们更改finalName
,也没有任何效果,因为我们的pom.xml
仍然相同.
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.
想象一下,我们的pom.xml
被定义为some-group:foo
.然后我们将finalName
更改为bar
,我不知道如何从repository
获取some-group:bar
.
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
.
没有任何关于some-group:bar
的描述.
这篇关于安装到本地存储库并部署到远程存储库时,如何在Maven中构建WAR项目并提供自定义名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!