Install File Using POM instead of commandline

前端 未结 1 2081
盖世英雄少女心
盖世英雄少女心 2020-12-24 02:36

I\'m currently using:

mvn install:install-file -Dfile={path/to/my/legacy.jar} -DgroupId=horrible -DartifactId=legacy.jar -Dversion=1.2.3 -Dpackaging=jar
         


        
1条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-24 02:46

    Okay, answering my own question :P. You can do this by defining properties, I originally assumed the groupId etc were auto exported as properties but they are not.

    
    
      4.0.0
      com.whatever
      Stuff
      1.2.3
    
      
      Description of why this horrible jar exists.
      
    
       
        ${project.groupId}
        ${project.artifactId}
        ${project.version}
        ${project.packaging}
        mylegacy.jar
      
    
      
        
          
            org.apache.maven.plugins
            maven-install-plugin
            
              
                install
                
                  install-file
                
              
            
          
        
      
    
    
    

    You can now install files using:

    mvn install
    

    and this pom.xml. I have tested this with maven 3 and not 2.

    For multiple files also see Maven POM file for installing multiple 3rd party commercial libraries

    0 讨论(0)
提交回复
热议问题