[英]How Can I List the Versions From a Maven Repository?
I'm trying to read out the artifact versions that are in a Maven repository in order to update my version numbers (yes, this is the best way to do this given the restrictions we have). 我试图读取Maven存储库中的工件版本以更新我的版本号(是的,考虑到我们的限制,这是执行此操作的最佳方法)。 I can see in the metadata.xml file for the repository that it's got the version information in it, but I'd like to avoid having to request that file directly. 我可以在存储库的metas.xml文件中看到其中包含版本信息的信息,但是我想避免不得不直接请求该文件。 I've so far been unable to find any documentation about Maven to do this. 到目前为止,我找不到有关Maven的任何文档来执行此操作。
A Maven repo is just a directory structure. Maven存储库只是一个目录结构。 Every version in its own subdirectory below the group and artificact directories. 每个版本都位于group和artificact目录下的自己的子目录中。
On JitPack, you get a plain text list of versions, for example https://jitpack.io/com/github/twogood/kronslott-sendgrid/ 在JitPack上,您会获得纯文本版本列表,例如https://jitpack.io/com/github/twogood/kronslott-sendgrid/
For oss.sonatype.org it's a directory listing, for example: https://oss.sonatype.org/content/repositories/releases/io/dropwizard/dropwizard-core/ 对于oss.sonatype.org,它是一个目录列表,例如: https ://oss.sonatype.org/content/repositories/releases/io/dropwizard/dropwizard-core/
Add the Versions Maven Plugin to your pom.xml
file. 将Versions Maven插件添加到您的pom.xml
文件。
To display the dependencies with newer versions available, run the command: 要显示具有较新版本的依赖项,请运行以下命令:
mvn versions:display-dependency-updates
To rewrite your pom.xml
file to use the latest release versions of the project's dependencies, run the command: 要重写pom.xml
文件以使用项目依赖项的最新发行版,请运行以下命令:
mvn versions:use-latest-releases
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.