问题描述
作为一个自动部署的一部分,我需要一个脚本来从我们的内部存储库下载最新版本的神器。
As part of an automated deployment I need a script to download the latest version of an artifact from our internal repository.
在理想情况下该脚本将与蚂蚁或UNIX shell脚本。
Ideally this script will be with ant or a unix shell script.
因此,例如:
我有myArtifact.war,它有版本1.0,1.1和2.0 - 我需要给予正确的组ID和工件ID来(目前使用artifactory的),从我们的Maven仓库取回2.0版剧本
I have myArtifact.war and it has versions 1.0 , 1.1 and 2.0 - I need the script given the correct group id and artifact id to retrieve version 2.0 from our maven repository (currently using artifactory).
有没有简单的方法来做到这一点?
Is there any easy way to do this?
推荐答案
您可以解析的maven-metadata.xml中,看看有什么版本可供选择,哪些版本是释放的版本。看到这个答案关于plugin版本的更多的细节。
You can parse the maven-metadata.xml to see what versions are available, and which version is the "release" version. See this answer about plugin versions for more details.
如果你正在使用的Nexus,你可以使用查询库。您也可以使用以简化处理。
If you are using Nexus, you can use the REST API to query the repository. You can also use the REST client API to simplify your processing.
要更新的发行版本,激活的在目标的文档。
The profile is activate by default in the maven-release-plugin's perform goal. It is controlled by the useReleaseProfile property. See the release-perform goal's documentation for more details.
这篇关于如何从Maven仓库找到最新版本的神器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!