Maven POM file for installing multiple 3rd party commercial libraries

后端 未结 3 1777
星月不相逢
星月不相逢 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:00

    You can just create pom.xml with multiple executions of install-file goal of Maven install plugin. Assuming those files are already available locally somewhere (or you can download them using Wagon plugin).

      
        4.0.0
    
        org.somegroup
        my-project
        1.0
    
        
          
            
              org.apache.maven.plugins
              maven-install-plugin
              2.4
              
                
                  install1
                  package
                  
                    install-file
                  
                  
                    lib/your-artifact-1.0.jar
                    org.some.group
                    your-artifact
                    1.0
                    ... other properties
                  
                
                
                  install2
                  package
                  
                    install-file
                  
                  ... etc
    
                
                ... other executions
              
            
          
        
      
    

    So, with above pom fragment mvn package should do the trick.

    There are good Maven POM tutorial and POM reference.

提交回复
热议问题