简体   繁体   English

如何列出Maven存储库中的版本?

[英]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.

相关问题 如何解决插件中Maven存储库中的工件? - How can I resolve an artifact from the Maven repository within a plugin? 如何扫描maven存储库? - How can I scan a maven repository? 在 Maven 存储库中查找特定插件的可用版本列表? - Finding list of versions available in a Maven repository for a specific plugin? 如何阻止 Maven 自动更新其本地存储库? - How can I stop Maven from automatically updating its local repository? 我如何创建对象类以执行从Maven存储库下载.jar依赖项 - How can i create an object class to perform downloading of .jar dependencies from maven repository 如何从 maven 的本地存储库中找出我可以使用哪些依赖项? - How to find out what kind of dependencies I can use from local repository in maven? 如何使用Java从Maven Nexus存储库下载工件列表 - How to download list of artifacts from maven nexus repository using Java 为什么我不能从本地存储库导入 maven jar? - why i can't import maven jar from local repository? 我如何告诉Maven比起增量版本更喜欢SNAPSHOT版本? - How can I tell maven to prefer SNAPSHOT versions over incremental versions? 如何在Nexus存储库管理器中绑定Maven工件的版本? - How do you peg versions of Maven artifacts in the Nexus repository manager?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM