eclipse maven exports the jar package that the project depends on

Since the project managed by the blogger is about to be handed over, some jars in the company need to be given to Party A's customers; so record the package guide process. spare

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

Or in eclipse, select the pom.xml file of the project, click Run As in the right-click menu, see the red box in the figure below, in the pop-up Configuration window, enter dependency: copy-dependencies, click Run

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. Setting the dependency level The jar packages that the maven project depends on will be copied to the lib directory in the project directory

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

{{o.name}}
{{m.name}}

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324158438&siteId=291194637