How to place the output jar into another folder with maven?

后端 未结 5 1838
故里飘歌
故里飘歌 2020-12-01 02:04

I\'d like to place my output jar and jar-with-dependencies into another folder (not in target/ but in ../libs/).

How can I do that?

5条回答
  •  悲哀的现实
    2020-12-01 02:21

    This technique worked well for me:

    http://maven.apache.org/plugins/maven-dependency-plugin/examples/copying-artifacts.html

    
      [...]
      
        
          
            org.apache.maven.plugins
            maven-dependency-plugin
            2.10
            
              
                copy
                package
                
                  copy
                
                
                  
                    
                      junit
                      junit
                      3.8.1
                      jar
                      false
                      ${project.build.directory}/alternateLocation
                      optional-new-name.jar
                    
                  
                  ${project.build.directory}/wars
                  false
                  true
                
              
            
          
        
      
      [...]
    
    

提交回复
热议问题