I did some boogle searching and found some examples of using curl to download the latest version using the nexus REST API.
Most the the examples I found were for sonatype.com and they used a password and username. I don't have a password and username and it was not clear to me how to adapt the example for a different repository like the mvnrepository.com.
Maven repositories follow a standard format. You can easily enumerate all the artifacts by browsing through the maven repository. You don't need a REST API (although it would be nice to have one) mvnrepository.com, despite the URL, isn;t the maven repository. It's just a website built on top of the real maven repository. The real maven repository is at http://central.maven.org/maven2/
I had abandoned that idea because I was worried about the format changing...
But you say it is Standard? Really?
That is good news....
Does that mean the format will never change?
Wow! OK! I just took a look... That looks like pretty minimal formatting... I guess that would work and I won't worry about a REST interface then. What a surprise!
Is this minimal format also used by the other repositories like the JBOSS and eclipse maven repositories?
Sound like a job for a groovy script using the httpclient html parser...
P.S. I would click on the question answered button if there was one!
Yeah, if the format changes, maven builds will fail all over the world. They might change the format when a major version of maven comes out.
If you are making a Mojo, you might have a way to do this using the Maven api. I don;t know enough to give you an answer. However, if do a little digging, you might find an API that maven provides. of course, you will be able to use it inside a Mojo only
Ok, but here is what I get from my little groovy program that does work (what a surprise!).
My question is: how do I know what the versions are? What regex can I use? should I assume that are always numeric with periods in between? I don't think that is a good assumption.
Can someone help me modify my little groovy program so it only prints the version numbers?
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop