Maven - how to include empty directories

后端 未结 5 1286
灰色年华
灰色年华 2020-11-30 07:25

By default during the build process maven is removing the empty directories.
Do you know if a parameter can be specified in the pom to instruct maven to include empty di

5条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-11-30 08:03

    Why do you need empty folders under target/test-classes?

    On the other hand you can use the assembly plugin to create empty folders in zip/tar.gz files.

    Just create an entry in your assembly descriptor which references an existing folder (in this case src/main/resources/bin...

    
      src/main/resources/bin
      /logs
      0755
      
        *
      
    
    

    The above works for .tar.gz and zip files as well. The directoryMode above is only needed if you create .tar.gz files.

    The second possibility is to create an empty folder in your folder structure which is included with the assembly plugin (like zip, tar.gz etc.)...BTW: zip, tar.gz allow empty folders.

提交回复
热议问题