简体   繁体   English

是否可以在不使用存储库的情况下引用Maven中的另一个本地项目目录?

[英]Is there a way to reference another local project directory in Maven without using a repository?

Say I have the following layout on my computer 说我的计算机上有以下布局

root-directory/
    projectA/
        moduleA1
        moduleA2
        moduleA3
        pom.xml <----------\
    projectB/              |
        moduleB1           | make B's pom.xml reference ../projectA/pom.xml ?
        moduleB2           |
        moduleB3           |
        pom.xml -----------/

projectB depends on/references projectA through our company's central (but local) Maven repository. projectB通过我们公司的中央(但本地)Maven存储库依赖/引用projectA。

I need some room to experiment with the interfaces in projectA that projectB depend on, without breaking every other team member's build by committing to our SVN repository - in fact, I want to avoid committing anything at all, including branches, until I have found a good solution the problem that I am actually trying to solve. 我需要一些空间来试验projectB所依赖的projectA中的接口,而不必通过提交到我们的SVN存储库来破坏其他团队成员的构建-实际上,我想避免提交任何东西,包括分支,直到找到一个好的解决方案我实际上正在尝试解决的问题。

It's by chance that projectA and projectB's directories are located in the same directory. 偶然的是,projectA和projectB的目录位于同一目录中。

It's only mean to be temporary while I work out some kinks, but I need to keep everything local on my computer. 这样做只是为了暂时,但我需要将所有内容保留在本地计算机上。

you can build your project B(mvn install). 您可以构建您的项目B(安装mvn)。 This puts the build B into your local repository. 这会将构建B放入您的本地存储库。 Now you can referenc it localy from project A. 现在您可以从项目A本地引用它。

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

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