Intellij maven dependency prefer local code

前端 未结 6 2217
野趣味
野趣味 2020-12-30 09:28

i\'m working on a project in which i have an android application project which has pom dependencies on other projects something like this:



        
6条回答
  •  醉梦人生
    2020-12-30 10:03

    We are dealing with the same problem...

    "IDEA should resolve dependencies as a module dependency type (rather than a local jar Maven library) if this Maven project is opened in IDE and it's version matches the version, installed in a local Maven repository."

    https://intellij-support.jetbrains.com/hc/en-us/community/posts/206836605-Always-prefer-local-module-source-over-Maven-dependencies

    Our solution was to add local Maven profile in pom.xml and specify local dependency version. To make it work, you have to turn on local profile.

    
        
            local
            
                x.x.x
            
        
    
    

    When local dependency is updated, you have to take care to update this version too, but currently this is the best solution we found and it's working for us.

提交回复
热议问题