Creating a zip archive of the maven “target” directory

后端 未结 2 1815
北恋
北恋 2020-12-05 06:25

I wish to create a zip archive of my \"target\" directory (${project.build.directory). using the maven-assembly-plugin seems to me like overkill for such a simple task (and

2条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-05 07:07

    If you don't have any "special" needs for the generated .zip file, you can use one of the pre-defined Maven Assembly descriptors. The pre-defined assembly descriptors make it easy to quickly and easily create specific assemblies without having to provide your own assembly descriptor. Suppose you wanted to use the bin pre-defined descriptor. Then in the plugins section of your POM's build section, you could just add the following.

    
      maven-assembly-plugin
      2.6
      
        
          bin
        
      
    
    

    Of course, as always with Maven, if you want to do something beyond the default configuration, you'll have to create your own configuration, and in this case, that means your own assembly descriptor.

    The list of pre-defined descriptors is documented here.

提交回复
热议问题