Given the following repository URL from my pom.xml how can I determine what the latest versions of spring and hibernate are available in the repository? http://repo1.maven.org/maven2
相关问题
- Delete Messages from a Topic in Apache Kafka
- Jackson Deserialization not calling deserialize on
- How to maintain order of key-value in DataFrame sa
- StackExchange API - Deserialize Date in JSON Respo
- Difference between Types.INTEGER and Types.NULL in
Retrieve the
maven-metadata.xml
file, placed in the artifact directory, e.g. http://repo1.maven.org/maven2/com/sun/media/jai_codec/maven-metadata.xml for an artefact with the groupIdcom.sun.media
and artifactIdjai_codec
.As Robert's answer says, the maven-metadata.xml file for each artifact in the repository holds the version information you need. In particular note the latest and release elements in the metadata. The latest element denotes the last version to be published, this may not be the version you want though. For example it could be a maintenance release to an older version, a release candidate, or a milestone. The release version denotes the last published version intended to be treated as a release, so generally you'd want to take this version.
For information the Maven super POM has a special release-profile profile, activated by setting the performRelease property (e.g. by passing -DperformRelease on the command line). Amongst other things, activating this property will set the updateReleaseInfo property of the deploy-plugin so that the metadata will be updated when you deploy.
Depending on what the real use case is, it can be worth looking at http://www.mojohaus.org/versions-maven-plugin/
Programatically or just manually?
Since the repository works over HTTP you can just navigate it manually:
http://repo2.maven.org/maven2/org/springframework/spring/ http://repo2.maven.org/maven2/org/hibernate/hibernate/ http://repo2.maven.org/maven2/org/hibernate/hibernate-core/