Maven Shade Plugin to produce two Jars

前端 未结 1 1945
暗喜
暗喜 2021-01-04 02:27

Till now I was using maven assembly plugin to generate two JARs for each artifact - compiled sources and dependencies - the reason for this was simple - deploying only the c

1条回答
  •  隐瞒了意图╮
    2021-01-04 03:09

    Instead of defining the plugin twice, simply define it once but with two execution sections. So in your situation it would be:

    
      
        org.apache.maven.plugins
        maven-shade-plugin
        
          
            shade-libs
            package
            
              shade
            
            
              target/assembly/${project.artifactId}-libs.jar
              
                
                  ...
                
              
              
                
                  META-INF/spring.handlers
                
                
                  META-INF/spring.schemas
                
              
            
          
          
            shade-main
            package
            
              shade
            
            
              target/assembly/${project.artifactId}.jar
              
                
                  ...
                
              
            
          
        
      
    
    

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