Skip to content

Instantly share code, notes, and snippets.

@amynbe
Created May 20, 2018 13:46
Show Gist options
  • Save amynbe/b62c05344d71bf292bedb8800dd3a431 to your computer and use it in GitHub Desktop.
Save amynbe/b62c05344d71bf292bedb8800dd3a431 to your computer and use it in GitHub Desktop.
Download artifiact jar and dependencies with maven
Method 1: use https://jar-download.com/online-maven-download-tool.php
Method 2 (tried with Maven 3.5.2):
##############################################
a. Download jar itself
b. Download pom
c. Download dependencies
d. Optional: download sources
e. Optional: download dependencies sources
Example below is for hibernate-hql-parser (http://mvnrepository.com/artifact/org.hibernate.hql/hibernate-hql-parser/1.5.0.Final)
##############################################
mvn dependency:get -Dartifact=org.hibernate.hql:hibernate-hql-parser:1.5.0.Final:jar -Ddest=.
mvn dependency:get -Dartifact=org.hibernate.hql:hibernate-hql-parser:1.5.0.Final:pom -Ddest=pom.xml
mvn dependency:copy-dependencies -DoutputDirectory=.
mvn dependency:get -Dartifact=org.hibernate.hql:hibernate-hql-parser:1.5.0.Final:jar:sources -Ddest=.
mvn dependency:copy-dependencies -DoutputDirectory=. -Dclassifier=sources
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment