使用Java项目作为其他项目中的jar文件作为Maven依赖项
我想使用一个Maven项目作为依赖项,而在其他项目中使用POM.xml进行限制很少.
I want to use one maven project as dependency using POM.xml in other project with few limitations.
我的Maven project1是框架项目.我已经为该项目创建了一个jar文件.该项目将驻留在私人git仓库中.我不想向其他用户公开此项目.
My Maven project1 is framework project. I have created a jar file for that project. This project will reside in a private git repo. I donot want to expose this project other user to edit it.
在我的maven project2或maven project3中,我想使用maven project1作为依赖项.在运行时应将jar文件降级为Maven依赖项.
In my maven project2 or maven project3 i want to use the maven project1 as dependency. the jar file should be downladed to maven dependencies during run time.
注意:用户在日食中将不会有mave project1.
Note: the user will not have mave project1 in his eclipse.
例如:当我将testNG依赖项添加到我的POM.xml中时,testNG jar将类似地下载到我的项目中,我需要将maven project1作为依赖项添加到任何其他maven项目中,并且应该将project1下调为jar.
For example: when i add testNG dependency to my POM.xml testNG jar will be downloaded to my project similarly, I need to add my maven project1 as dependency to any other maven project and it should downlod project1 as jar.
请让我知道如何实现.
我想您应该将项目上传到Maven存储库: https://maven.apache.org/guides/mini/guide-central-repository-upload.html
I guess you should upload your project to the Maven repository: https://maven.apache.org/guides/mini/guide-central-repository-upload.html