Monday, 3 September 2012

Maven Dependency Download

Heres a quick hack to download jars and their dependencies from a maven repository, without a proper maven project or any other dependency management tools. For times when you just want the damn jars!All you need is maven installed.

Here is a template pom.xml

<project xmlns="" xmlns:xsi=""
        <!-- Put your dependencies here -->

Put your maven style dependencies under the dependencies tag. In the examlple above you can see that I have specified the apache poi dependency. The dependency tags for other jars can be found here: 

Now open terminal (command prompt) and navigate to where you have saved the pom.xml file. 

Run the following command 
mvn dependency:copy-dependencies

This will download the dependencies, as well as its dependencies(transitively). The jars will be located under target/dependency

No comments:

Post a Comment