views:

1123

answers:

6

Is there a maven client that isn't mvn (the binary included with the maven distribution) I could use to pull down an artifact from a maven repository without using a pom? I'd like to use a maven repository as the repo for our ops team to pick up builds (including snapshots of builds) but I don't want them to have to mess around with writing poms and declaring dependencies in them. Ideally, I'm looking for just a cli client that I could just pass in a repo url and coordinates and download a given artifact. Does such a thing exist or am I better off writing a one-off script for this?

+2  A: 

Use the maven embedder. More to the point, use the functionality inside the maven embedder for resolving and downloading jars. Although if you're trying to just write a simple CLI, the repository structure isn't complex and you could easily write a script that takes a maven repo url, artifact ID, group ID and version to generate the full URL to the jar.

Jherico
+3  A: 

Use Nexus. It provides a web interface that other teams can use to download artifacts. http://nexus.sonatype.org/

Taylor Leese
I was already using Nexus and I just found out about their url api for yanking down artifacts based on coordinates. One of the nexus devs informed me of it on their irc channel yesterday. thanks for the answer though.
whaley
A: 

Well technically the repository is accessed over HTTP, so given the repository location, artifact and coordinates, it should just be possible to give your ops team a URL to the artifact that they can hit in any browser.

matt b
That gets a little hairy with snapshots, since the actual artifact filename in the repository has a timestamp and I wanted them to be able to pull down any artifact in a programmatic fashion. I was already using nexus and it turns out they have an api for this already.
whaley
Gotcha - good to know about nexus
matt b
@whaley can you post a link to the Nexus API?
Rich Seller
A: 

Think about Pax URL which lets you use plain URLs to reference maven artifacts like so:

mvn:groupId/artifactId/version

See PAX URL Website for more info (MVN Protocol Handler).

Toni

Toni Menzel
A: 

I see 3 easy options:

  1. Just send them a link pointing on your artifact in your repository and have them use their browser.
  2. Install and use wget (wget http://path/to/artifact.extension).
  3. Install and use mvn dependency:get (requires mvn but doesn't require a pom.xml, see this answer for more details).
Pascal Thivent
A: 

I believe this is the api whaley is referring to

http://nexus.sonatype.org/nexus-faq.html#25

seanp33