You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Kevin Smathers <kn...@gmail.com> on 2012/01/19 19:16:35 UTC

Using Maven Assembly plugin to create tar file with absolute paths

I would like to be able to create an assembly descriptor that will
allow me to create a tar file of my project resources with an absolute
path in the file name.  I have tried something like the following:

<assembly>
	<id>deployment</id>
	<formats>
		<format>tar</format>
	</formats>
	<includeBaseDirectory>true</includeBaseDirectory>
	<baseDirectory>/opt/path/to/deployment</baseDirectory>
	<files>
           ....
	</files>
        ....
</assembly>

However, I've found that this creates a tar file with only
"opt/path/..." rather than "/opt/path..."  I also found that if I
specify the baseDirectory with *4* leading slashes (like
"////opt/path/to/deployment"), it includes a / at the beginning of the
path, but this seems a hack and not a reasonable workaround to depend
upon going forward.  I have found that there is some code in the
assembly plugin that strips leading /'s in file prefix names.  I've
also found that the TarArchiver has an option to allow leading slashes
in file names, but I have not been able to locate a way to turn this
property on via any kind of configuration within Maven.

I know absolute path names in tar files are generally not a great
idea, but our infrastructure team has requested that we deliver builds
to them in this way to work with their automated build scripts.

Does anyone have any ideas on how I can go about doing this the "right" way?

Thanks in advance!

Kevin

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org