Idea is using different version of library than defined in project

时间:2016-08-31 17:49:00

标签: maven intellij-idea

I have a maven project opened in IntelliJ Idea. Maven build(executed from IDE) works fine, but when I try to run the some JUnit test, it shows me some import issues, because some older version of one library is used. The library is called sf-gml-api and the desired version is 1.50.3, but in the External Libraries node in the project, idea shows this:

External Libraries

The obvious thing to check is if some other library doesn't depend on this version, but mvn dependency:tree seems to be in order - correct version everywhere.

> mvn dependency:tree | grep sf-gml-api
[INFO] +- com.snowflakesoft.common:sf-gml-api:jar:1.50.3:compile
[INFO] |  +- com.snowflakesoft.common:sf-gml-api:jar:1.50.3:compile
[INFO] |  +- com.snowflakesoft.common:sf-gml-api:jar:1.50.3:compile
[INFO] |  |  +- com.snowflakesoft.common:sf-gml-api:jar:1.50.3:compile
[INFO] |  |  |  +- com.snowflakesoft.common:sf-gml-api:jar:1.50.3:compile
[INFO] |  |  |  |  +- com.snowflakesoft.common:sf-gml-api:jar:1.50.3:compile
[INFO] |  |  |  |  |  +- com.snowflakesoft.common:sf-gml-api:jar:1.50.3:compile
[INFO] |  |  +- com.snowflakesoft.common:sf-gml-api:jar:1.50.3:compile
[INFO] |  |  |  +- com.snowflakesoft.common:sf-gml-api:jar:1.50.3:compile
[INFO] |  |  +- com.snowflakesoft.common:sf-gml-api:jar:1.50.3:compile
[INFO] |  |  |  +- com.snowflakesoft.common:sf-gml-api:jar:1.50.3:compile
[INFO] |  +- com.snowflakesoft.common:sf-gml-api:jar:1.50.3:compile
[INFO] |  |  +- com.snowflakesoft.common:sf-gml-api:jar:1.50.3:compile
[INFO] |  |     +- com.snowflakesoft.common:sf-gml-api:jar:1.50.3:compile
[INFO] |  |  |     +- com.snowflakesoft.common:sf-gml-api:jar:1.50.3:compile
[INFO] |  |  |     +- com.snowflakesoft.common:sf-gml-api:jar:1.50.3:compile
[INFO] |  |  |  |     +- com.snowflakesoft.common:sf-gml-api:jar:1.50.3:compile
[INFO] |  |  +- com.snowflakesoft.common:sf-gml-api:jar:1.50.3:compile
[INFO] |  |  |     +- com.snowflakesoft.common:sf-gml-api:jar:1.50.3:test
[INFO] |  |  |     |     +- com.snowflakesoft.common:sf-gml-api:jar:1.50.3:compile
[INFO] |  +- com.snowflakesoft.common:sf-gml-api:jar:1.50.3:compile
[INFO] |  |  +- com.snowflakesoft.common:sf-gml-api:jar:1.50.3:compile
[INFO] |  |  |  +- com.snowflakesoft.common:sf-gml-api:jar:1.50.3:compile
[INFO] |  |  |     |     +- com.snowflakesoft.common:sf-gml-api:jar:1.50.3:provided
[INFO] |  |  |     |     +- com.snowflakesoft.common:sf-gml-api:jar:1.50.3:compile
[INFO] |  |  |  |     |     +- com.snowflakesoft.common:sf-gml-api:jar:1.50.3:compile
[INFO] |  |  |  |     |     +- com.snowflakesoft.common:sf-gml-api:jar:1.50.3:compile
[INFO] |  |  |  |  +- com.snowflakesoft.common:sf-gml-api:jar:1.50.3:compile
[INFO] |  |  |  |  +- com.snowflakesoft.common:sf-gml-api:jar:1.50.3:compile
[INFO] |  |  |  |  +- com.snowflakesoft.common:sf-gml-api:jar:1.50.3:compile
[INFO] |  +- com.snowflakesoft.common:sf-gml-api:jar:1.50.3:compile
[INFO] |  |  |  |  |  +- com.snowflakesoft.common:sf-gml-api:jar:1.50.3:compile
[INFO] |  |  +- com.snowflakesoft.common:sf-gml-api:jar:1.50.3:compile
[INFO] |  +- com.snowflakesoft.common:sf-gml-api:jar:1.50.3:compile

I've tried maven reimport in Idea, but without any luck. What could be the issue? The dependencies are only defined in the pom files.

  • IntelliJ Idea 14.1.4
  • Maven 3.2.3

2 个答案:

答案 0 :(得分:0)

清除~/.IntelliJIdea14/system/Maven并没有帮助缓存和重启无效。

修复问题的原因是安装了Idea update 2016.1.4

答案 1 :(得分:0)

我会检查你是否从Open Module Settings中删除它 - >库和刷新工作区。如果它仍然存在,请尝试通过intellij分析此库,右键单击库和Analazy - >分析依赖关系。