https://my.oschina.net/cloudcoder/blog/212648
Abstract: When deploying the project, you need to export the jars that the maven project depends on to the specified directory. This article explains how to export the jar packages that the project depends on.
When deploying the project, you need to export the jars that the maven project depends on to the specified directory. This article explains how to export the jar packages that the project depends on.
1. Export to the default directory targeted/dependency
Export the jar package that the project depends on from the Maven project: enter the directory where the project pom.xml is located, and execute the following command:
1
|
mvn dependency:copy-dependencies
|
The jar packages that the maven project depends on will be exported to the targeted/dependency directory.
2. Export to a custom directory
Create a lib folder under the maven project and enter the following command:
1
|
mvn dependency:copy-dependencies -DoutputDirectory=lib
|
3. Set the dependency level
At the same time, the dependency level can be set, usually the compile level is used
1
|
mvn dependency:copy-dependencies -DoutputDirectory=lib -DincludeScope=compile
|