Use case:
Tired of having unwanted jars? Tired of finding dependent jars? Maven shall help to download all the dependencies of the project into a folder.
Solution:
If you already have a pom.xml execute command “mvn dependency:copy-dependencies” and you will find target/dependencies folder filled with all the dependencies.
Else you can create simple pom.xml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.ourownjava</groupId> <artifactId>ourownjava</artifactId> <packaging>jar</packaging> <version>0.0.1-SNAPSHOT</version> <name>Dependencies</name> <url>https://ourownjava.com</url> <dependencies> <dependency> <groupId>log4j</groupId> <artifactId>log4j</artifactId> <version>1.2.17</version> </dependency> </dependencies> <repositories> <repository> <id>java.net</id> <name>java.net</name> <url>https://maven.java.net/content/repositories/public/</url> </repository> </repositories> </project> |