bundling multiple artifact for deployment?

前端 未结 1 1891
无人共我
无人共我 2021-01-20 04:21

This is follow up based on this answer.

I have a structure that looks like

$ ls service/target/
classes             lib             maven-status          


        
1条回答
  •  迷失自我
    2021-01-20 05:04

    You can use maven-assembly-plugin to do that task.

    Create an assembly definition file in src/assembly/distribution.xml

    
        distribution
        
            tar
        
        
            
                ${project.build.directory}/${project.build.finalName}.${project.packaging}
            
        
        
            
                ${project.build.directory}/lib
                lib
            
        
    
    

    In pom.xml file, add plugin declare, execution phase and goal for it.

    
        maven-assembly-plugin
        2.5.5
        
            ${project.basedir}/src/assembly/distribution.xml
        
        
            
                make-assembly
                package
                
                    single
                
            
        
    
    

    More format file or customize of maven-assembly-plugin can be found here: https://maven.apache.org/plugins/maven-assembly-plugin/

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