[英]Multiple module projects with intellij
我有2个项目,ProjectA和ProjectB。 ProjectB是一个独立的项目,而ProjectA依赖于ProjectB。 当然,ProjectA中的pom具有ProjectB的依赖关系,如下所示:
<overlays>
<overlay>
<groupId>ProjectB</groupId>
<artifactId>ProjectBwar</artifactId>
</overlay>
</overlays>
...
<dependency>
<groupId>ProjectB</groupId>
<artifactId>ProjectBwar</artifactId>
<version>ProjectBVersion</version>
<type>war</type>
</dependency>
当仅使用ProjectA时,一切都很好。 将ProjectB的模块导入到同一项目后,Intellij可以很好地导入它,但是它仍使用对构建的maven依赖关系,并且我无法对ProjectB中所做的更改进行任何测试。 有没有办法告诉Intellij不要使用maven依赖,而要使用我导入的模块? 我已经尝试过进入项目结构,但是不确定要去哪里以及要更改什么。 任何帮助,将不胜感激! 谢谢!
将您的库模块添加为项目依赖项,对库的任何更改将立即在您的项目中可见。 假设您的IntelliJ项目中同时包含项目和库模块,请转到:
File > Project Structure > Modules > select your project module > Dependencies > + > Module Dependency > select your library module
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.