Maven creating flat zip assembly

后端 未结 1 1845
清酒与你
清酒与你 2021-01-07 18:15

To Maven gurus out there: I\'m trying to package non-java project artifacts (.NET) into a single zip file. I\'m having 2 problems:

If I change packaging in my POM to

1条回答
  •  Happy的楠姐
    2021-01-07 18:47

    As you've seen, there isn't a zip packaging type, so it makes sense to use pom packaging as you've chosen to.

    You've encountered a bit of a hole in the assembly plugin's processing. You could resolve this by specifying multiple fileSets in the assembly with /, one for each directory you want to include, this is obviously a PITA, and probably not an acceptable solution.

    An alternative approach is to use the Ant copy task to copy all the DLLs into a staging directory, then include that directory in the assembly.

    The following configuration should do what you're after:

    The antrun-plugin configuration:

      
        maven-antrun-plugin
        1.3
        
          
            process-resources
            
              
                
                  
                    
                    
                  
                  
                
              
            
            
              run
            
          
        
      
    

    The assembly:

     
      bin
      
        zip
      
      
        
          ${project.build.directory}/dll-staging
          /
          
            *.dll
            *.pdb
          
        
      
    
    

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