Jay Taylor's notes
back to listing indexA simple command line to download a remote maven2 artifact to the local repository?
[web search]
I have a library that I distribute using maven 2. The typical user of this library doesn't use maven to build their applications, but is likely somewhat familiar with maven and probably has it installed. I'd like to document a "simple" one line command they can use to download my library's artifacts to their local I thought there was a way to do this, but I can't seem to find it after looking through the
but I think I'm barking up the wrong tree since it appears that the install plugin is used to copy locally built files into the local repository, rather than download remote artifacts into the local repository. This is the artifact I'd like to install: http://download.java.net/maven/2/robo-guice/robo-guice/0.4-SNAPSHOT/ Is this possible using maven? |
|||||||||
|
|||||||||
Since version 2.1 of the Maven Dependency Plugin, there is a dependency:get goal for this purpose. To make sure you are using the right version of the plugin, you'll need to use the "fully qualified name": mvn org.apache.maven.plugins:maven-dependency-plugin:2.1:get \ -DrepoUrl=http://download.java.net/maven/2/ \ -Dartifact=robo-guice:robo-guice:0.4-SNAPSHOT |
|||||||||||||||||||||||||||||||||
|
Give them a trivial pom with these jars listed as dependencies and instructions to run:
This will pull the dependencies to the local repo. A more direct solution is dependency:get, but it's a lot of arguments to type:
|
|||||||||||||||||||||||||||
|
As of version 2.4 of the Maven Dependency Plugin, you can also define a target destination for the artifact by using the -Ddest flag. It should point to a filename (not a directory) for the destination artifact. See the parameter page for additional parameters that can be used
|
|||||||||||||||
|
Your Answer
Not the answer you're looking for? Browse other questions tagged maven-2 or ask your own question.
asked |
6 years ago |
viewed |
87437 times |
active |
Linked
Related
Hot Network Questions
- Baking in drinking glasses -- heat vs. logo paint, other issues
- Prepared for Yet Another Simple Rebus?
- Why did the best potions master have greasy hair?
- Draw some mountain peaks
- "get used to cycle" or "get used to cycling"
- Formal word when someone goes on the attack
- What kind of battery does the Pokémon Go Plus have?
- Is "she don't" sometimes considered correct form?
- If I receive written permission to use content from a paper without citing, is it plagiarism?
- Why does this chart seem to show airports with magnetic variation up to 90 degrees?
- Teenage daughter refusing to go to school
- How small could an animal be before it is affected by quantum mechanics?
- A hat puzzle involving wizards
- Can I switch from past tense to present tense in an epilogue?
- How to harness Jupiter's gravitational energy?
- Is it safe to use cheap USB data cables?
- I just saw this bird outside my apartment. Anyone know what it is?
- What commercial flight route requires the most (minimum possible) stops/layovers from A to B?
- Why do I never get a mention at work?
- In a company crossing multiple timezones, is it rude to send a co-worker a work email in the middle of the night?
- How exactly do I null my metal detector coils?
- Advisor professor asks for my dissertation research source-code
- Does every interesting photograph have a story to tell?
- How do I preserve line breaks when getting text from a textarea?
Technology | Life / Arts | Culture / Recreation | Science | Other | ||||||
---|---|---|---|---|---|---|---|---|---|---|