简体   繁体   English

如何从eclipse导出一个java Maven文件

[英]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?如何从 eclipse 导出 java maven 文件以及所有外部库和 maven 依赖项,以便其他人打开时不必下载和导入外部库?

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 Windows: C:\Users<用户名>.m2

Linux: /home/<User_Name>/.m2 Linux: /home/<用户名>/.m2

Mac: /Users/<user_name>/.m2 Mac:/Users/<用户名>/.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 mvn 安装依赖项:复制依赖项

You can also specify the folder.您也可以指定文件夹。

mvn dependency:copy-dependencies -DoutputDirectory=specific-folder/ mvn dependency:copy-dependencies -DoutputDirectory=特定文件夹/

To make use of these commands you will have to install Apache Maven Dependency Plugin要使用这些命令,您必须安装Apache Maven 依赖插件

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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