如何在Intellij IDEA中使用maven时禁用项目的自动依赖而不是唯一的jar? [英] How to disable auto-depend on the project but not the only jar when using maven in Intellij IDEA?
问题描述
我在Intellij IDEA 11.1.2中使用Maven,我正在处理两个不同的项目,其中一个项目取决于另一个项目。
I am using Maven in Intellij IDEA 11.1.2, and i am working on two different projects and one of them depends on the other one.
项目A的pom .xml如下:
Project A's pom.xml as following
<dependency>
<groupId>project.b</groupId>
<artifactId>project.b</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
然后IntellIj IDEA将自动依赖项目B.有时我可以编译项目A使用mvn命令行,但IDEA显示源代码中存在许多错误,解决此问题的唯一方法是从本地文件系统中删除项目b,然后将其从IDEA中删除。
Then IntellIj IDEA will automaticly depend on project B. Sometimes i can compile project A useing mvn command line, but the IDEA shows there are many errors in the source code, and the only way to fix this is removing the project b from the local file systems then removing it from the IDEA.
所以我想让IDEA自动依赖项目但只有jar并执行pom.xml要求它做的事情。
So i want to diable IDEA to auto-depend on the project but only the jar and do what the pom.xml tells it to do.
提前致谢。
推荐答案
正如@CrazyCoder所说,
As @CrazyCoder said,
SNAPSHOT依赖项通过项目源位置解析
SNAPSHOT dependencies are resolved via project source location
我接受这个事实。
这篇关于如何在Intellij IDEA中使用maven时禁用项目的自动依赖而不是唯一的jar?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!