Getting dependent jars together in a folder. Can be used as an alternative to fat jar.
1 |
mvn dependency:copy-dependencies -DoutputDirectory=${project.build.directory}/lib |
Getting dependent jars together in a folder. Can be used as an alternative to fat jar.
1 |
mvn dependency:copy-dependencies -DoutputDirectory=${project.build.directory}/lib |
How to package the project with mvn command when external repos are not available, but we are happy to get dependencies from local repositories:
1 |
mvn clean -o package |
Some Maven commands I often use recently:
Skip tests (not for deployment to production :))
1 |
mvn clean package -Dmaven.test.skip=true |
Adding local jar to maven repository.
Syntax:
1 |
mvn install:install-file -Dfile=<path-to-file> -DgroupId=<group-id> -DartifactId=<artifact-id> -Dversion=<version> -Dpackaging=<packaging> |
Example:
1 |
mvn install:install-file -Dfile=dans-dbf-lib-1.0.0-beta-10.jar -DgroupId=nl.knaw.dans.common -DartifactId=dans-dbf-lib -Dpackaging=jar -Dversion=1.0.0-beta-10 |