You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Damjan Jovanovic (JIRA)" <ji...@codehaus.org> on 2011/12/14 08:37:02 UTC

[jira] (MASSEMBLY-515) Creating TAR fails on machine with UTF-8 platform encoding

    [ https://jira.codehaus.org/browse/MASSEMBLY-515?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=285858#comment-285858 ] 

Damjan Jovanovic commented on MASSEMBLY-515:
--------------------------------------------

See http://jira.codehaus.org/browse/PLXCOMP-195 where I posted a fix.

                
> Creating TAR fails on machine with UTF-8 platform encoding
> ----------------------------------------------------------
>
>                 Key: MASSEMBLY-515
>                 URL: https://jira.codehaus.org/browse/MASSEMBLY-515
>             Project: Maven 2.x Assembly Plugin
>          Issue Type: Bug
>    Affects Versions: 2.2
>         Environment: Fedora 13 (2.6.34.7-56.fc13.x86_64)
> Maven 2.2.1
> Java 1.6.0_20
>            Reporter: Audun Røe
>         Attachments: assemblytest.tar.gz
>
>
> I suddenly started getting the following error from maven-assembly-plugin (2.2) when building the assembly for an existing project. A colleague on Windows did not experience the issue:
> [INFO] Failed to create assembly: Error creating assembly archive XYZ: Problem creating TAR: request to write '145' bytes exceeds size in header of '144' bytes.
> Google suggested tarLongFileMode as a starting-point for troubleshooting, and changing this to "omit" made the build start working again. Loads of files were being excluded, however, including files predating the build-failure. Gradually eliminating newer files eventually revealed the culprit; a file with a long filename/path containing more than one non US-ASCII character. 
> So to summarize, the requirement seems to be:
> 1. files with name+path long enough to require tarLongFileMode=gnu (probably - I haven't tested the threshold extensively but shorter files seems to work fine no matter how many specials chars they contain)
> 2. Platform encoding is UTF-8, hence why it wasn't seen on my colleague's machine as it was using Windows' equivalent of iso-8859-1
> 3. The filename must contain _more_ than one character resulting in an UTF-8 multibyte sequence, for instance the characters æ, ø or å.
> The simple workaround for now is to simply rename any offending files.
> I've attached an example project that reproduces the issue on my machine. It has a simple pom, an assembly-descriptor, and some empty textfiles under resources; one of which triggers this bug. 
> Running it with "mvn clean install -e" produces the following output:
> [INFO] ------------------------------------------------------------------------
> [ERROR] BUILD ERROR
> [INFO] ------------------------------------------------------------------------
> [INFO] Failed to create assembly: Error creating assembly archive assemblytest-1.0-SNAPSHOT: Problem creating TAR: request to write '115' bytes exceeds size in header of '112' bytes
> [INFO] ------------------------------------------------------------------------
> [INFO] Trace
> org.apache.maven.lifecycle.LifecycleExecutionException: Failed to create assembly: Error creating assembly archive assemblytest-1.0-SNAPSHOT: Problem creating TAR: request to write '115' bytes exceeds size in header of '112' bytes
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:719)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
> 	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
> 	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
> 	at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
> 	at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:597)
> 	at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
> 	at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
> 	at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
> 	at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
> Caused by: org.apache.maven.plugin.MojoExecutionException: Failed to create assembly: Error creating assembly archive assemblytest-1.0-SNAPSHOT: Problem creating TAR: request to write '115' bytes exceeds size in header of '112' bytes
> 	at org.apache.maven.plugin.assembly.mojos.AbstractAssemblyMojo.execute(AbstractAssemblyMojo.java:468)
> 	at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
> 	... 17 more
> Caused by: org.apache.maven.plugin.assembly.archive.ArchiveCreationException: Error creating assembly archive assemblytest-1.0-SNAPSHOT: Problem creating TAR: request to write '115' bytes exceeds size in header of '112' bytes
> 	at org.apache.maven.plugin.assembly.archive.DefaultAssemblyArchiver.createArchive(DefaultAssemblyArchiver.java:196)
> 	at org.apache.maven.plugin.assembly.mojos.AbstractAssemblyMojo.execute(AbstractAssemblyMojo.java:409)
> 	... 19 more
> Caused by: org.codehaus.plexus.archiver.ArchiverException: Problem creating TAR: request to write '115' bytes exceeds size in header of '112' bytes
> 	at org.codehaus.plexus.archiver.AbstractArchiver.createArchive(AbstractArchiver.java:888)
> 	at org.apache.maven.plugin.assembly.archive.archiver.AssemblyProxyArchiver.createArchive(AssemblyProxyArchiver.java:512)
> 	at org.apache.maven.plugin.assembly.archive.DefaultAssemblyArchiver.createArchive(DefaultAssemblyArchiver.java:192)
> 	... 20 more
> Caused by: java.io.IOException: request to write '115' bytes exceeds size in header of '112' bytes
> 	at org.codehaus.plexus.archiver.tar.TarOutputStream.write(TarOutputStream.java:286)
> 	at org.codehaus.plexus.archiver.tar.TarOutputStream.write(TarOutputStream.java:265)
> 	at org.codehaus.plexus.archiver.tar.TarOutputStream.putNextEntry(TarOutputStream.java:180)
> 	at org.codehaus.plexus.archiver.tar.TarArchiver.tarFile(TarArchiver.java:296)
> 	at org.codehaus.plexus.archiver.tar.TarArchiver.execute(TarArchiver.java:207)
> 	at org.codehaus.plexus.archiver.AbstractArchiver.createArchive(AbstractArchiver.java:871)
> 	... 22 more

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira