Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

Use maven to extract the dependent jar of the project to the specified folder

Shulou Source: shulou.com Published: 2022-06-03 07:19:51 11月23日 Update

Sometimes it is necessary for maven to extract all dependent jar files of the current project to a specified folder. You can use maven-dependency-plugin to implement

1. Add the following to pom.xml:

Maven-dependency-plugin

${project.build.directory} / lib

False

True

...

* where ${project.build.directory} is the maven variable, indicating the target directory. If you do not write, the lib directory will be created under the root directory.

* excludeTransitive, indicating whether there are no indirectly dependent packages

* stripVersion means that the version information is removed from the copied jar file.

two。 Execute mvn dependency:copy-dependencies

All dependent jar will be extracted to the lib directory

Tags: Files directories folders projects information contents variables root directories versions Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno OPPO Reno Huawei Xiaomi macOS Microsoft