Thank you all, I ended up using some of Jason's code but also consume remote maven-metadata.xml to resolve SNAPSHOT, LATEST, and RELEASE artifacts
-D On Sat, Jan 17, 2015 at 8:05 AM, Jason Swank <[email protected]> wrote: > Hi Dan, > > This is probably not really what you're looking for, but seems like a good > time to mention it. > > A feature was recently added to search.maven.org to assist with using a > stable link to components in Central (for documentation and other spots > where that is required) : given a group, artifact, and version (RELEASE, > LATEST, or version number) a redirect is returned to the artifact in > Central. For instance: > > $ curl -i " > > https://search.maven.org/remote_content?g=com.squareup.okhttp&a=okhttp&v=LATEST > " > > HTTP/1.1 302 Moved Temporarily > Server: nginx/0.8.55 > Date: Sat, 17 Jan 2015 15:56:12 GMT > Content-Type: text/plain > Connection: keep-alive > Location: > > https://repo1.maven.org/maven2/com/squareup/okhttp/okhttp/2.2.0/okhttp-2.2.0.jar > Content-Length: 0 > > $ curl -i " > > https://search.maven.org/remote_content?g=com.squareup.okhttp&a=okhttp&v=2.2.0 > " > > HTTP/1.1 302 Moved Temporarily > Server: nginx/0.8.55 > Date: Sat, 17 Jan 2015 16:01:37 GMT > Content-Type: text/plain > Connection: keep-alive > Location: > > https://repo1.maven.org/maven2/com/squareup/okhttp/okhttp/2.2.0/okhttp-2.2.0.jar > Content-Length: 0 > > You can see an example of this in the OkHttp docs: > https://github.com/square/okhttp > > Jason > > > On Fri, Jan 16, 2015 at 9:15 PM, Dan Tran <[email protected]> wrote: > > > Hi > > > > Is there a API to convert a maven coordinate ( including snapshot) to a > > URL? > > > > I would like the obtain the URL and and do the download myself > > > > > > Thanks > > > > -Dan > > >
