Maven project depending on two versions of the same artifact

前端 未结 2 1359
谎友^
谎友^ 2020-12-03 17:49

I have a project with two seperate modules that uses sqlline and another library(say OtherLib) that depends on jline. However on different versions.

External Librari

2条回答
  •  既然无缘
    2020-12-03 18:30

    I found a an answer here using maven-dependency-plugin

    In pom.xml

    
       
          
             org.apache.maven.plugins
             maven-dependency-plugin
             2.1
             
               
                   copy-model
                   package
                   
                      copy
                   
                   
                     
                       
                           jline
                           jline
                           2.10
                           jar
                       
                     
                     ../../resources/lib
                   
               
            
         
         
     
       
    

    And in assembly.xml

       
            ../../resources/lib
            ${HOME}/lib/module1
            755
            644
            
                jline-*
            
        
    

    jline-0.9.94 is included in a dependencySet as any other dependency. I hope this helps. :)

提交回复
热议问题