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

后端 未结 5 1831
故里飘歌
故里飘歌 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:42

    If you want to copy the artifact into a directory outside your project, solutions might be:

    • maven-jar-plugin and configure outputDirectory
    • maven-antrun-plugin and copy task
    • copy-maven-plugin by Evgeny Goldin

    Example for the copy-maven-plugin is:

    
        com.github.goldin
        copy-maven-plugin
        0.2.5
        
            
                deploy-to-local-directory
                install
                
                    copy
                
                
                    false
                    false
                    
                        
                            Copy artifact to another directory
                            /your/local/path
                            ${project.build.directory}
                            
                                *.jar
                            
                        
                    
                
            
        
    
    

提交回复
热议问题