简体   繁体   中英

How to export a java Maven file from eclipse

How to export a java maven file from eclipse with all external libraries and maven dependacies so the other peorson opening does not have to download and import the external libraries?

I tried the Archive file exporting method. But it wasn't successful, cause it lost the external libraries while importing, and it lost clases and packages.

The default local repository is located based on OS:

Windows: C:\Users<User_Name>.m2

Linux: /home/<User_Name>/.m2

Mac: /Users/<user_name>/.m2

Assuming that you want to store these dependencies in the project folder so that every user does not have to download and import the external libraries according to this source you can download all your dependencies to the target folder with the following command.

mvn install dependency:copy-dependencies

You can also specify the folder.

mvn dependency:copy-dependencies -DoutputDirectory=specific-folder/

To make use of these commands you will have to install Apache Maven Dependency Plugin

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM