Search code examples
javamavenbuildm2eclipsesonarqube

Maven assembly set username for tar


I'm using Maven with the Assembly plugin and would like to set the user and group for a tar-file.

I can set access rights to every directory, but without setting the user this is quite useless.

Any ideas?


Solution

  • The tar is created with the permission of the user running it. If you want this to be a particular user/group you can run maven as that user/group.

    Maven may not allow you to use tar as a different user, but if you can do it in ant you can use http://maven.apache.org/plugins/maven-antrun-plugin/ to do anything ant can do.

    http://maven.apache.org/plugins/maven-antrun-plugin/usage.html