Maven POM file for installing multiple 3rd party commercial libraries

后端 未结 3 1874
星月不相逢
星月不相逢 2021-01-31 19:19

I have a bunch of projects which are dependant on a set of commercial 3rd party libraries. We currently don\'t have a company repository so I have to install the libraries in my

3条回答
  •  灰色年华
    2021-01-31 20:10

    Recently discovered a new solution to this. Basically you can create a local repository within the project which can be checked in with the rest of the source code. Blogged about it here: http://www.geekality.net/?p=2376.

    The gist is to deploy dependencies to a folder in your project.

    mvn deploy:deploy-file
        -Durl=file:///dev/project/repo/
        -Dfile=somelib-1.0.jar
        -DgroupId=com.example
        -DartifactId=somelib
        -Dpackaging=jar
        -Dversion=1.0
    

    And then simply let Maven know about it and use dependency declarations as normal through your pom.xml.

    
        
            project.local
            project
            file:${project.basedir}/repo
        
    
    
    
        com.example
        somelib
        1.0
    
    

    Not extremely Maven'y, but it works and moving the dependencies to a company repository later should be quite simple.

提交回复
热议问题