You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Dan Fabulich (JIRA)" <ji...@codehaus.org> on 2007/12/08 04:19:57 UTC

[jira] Updated: (MSHADE-9) failure to shade/relocate plexus-archiver (interfaces not properly relocated)

     [ http://jira.codehaus.org/browse/MSHADE-9?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dan Fabulich updated MSHADE-9:
------------------------------

    Description: 
I tried using the shade plugin with surefire, to shade/relocate plexus-archiver.  I'm trying to relocate its package to be org.apache.maven.surefire.shaded.org.codehaus.plexus.archiver.  It took several tries due to MSHADE-5, but even when it finally "worked", it failed to modify plexus-archiver correctly.

org.codehaus.plexus.archiver.zip.AsiExtraField implements org.codehaus.plexus.archiver.zip.ZipExtraField.  But when I try to run p-archiver after shading it, I get this exception:

java.lang.ExceptionInInitializerError
        at org.apache.maven.surefire.shaded.org.codehaus.plexus.archiver.zip.ZipEntry.getCentralDirectoryExtra(ZipEntry.java:386)
        at org.apache.maven.surefire.shaded.org.codehaus.plexus.archiver.zip.ZipOutputStream.writeCentralFileHeader(ZipOutputStream.java:769)
        at org.apache.maven.surefire.shaded.org.codehaus.plexus.archiver.zip.ZipOutputStream.finish(ZipOutputStream.java:320)
        at org.apache.maven.surefire.shaded.org.codehaus.plexus.archiver.zip.ZipOutputStream.close(ZipOutputStream.java:542)
        at org.apache.maven.surefire.shaded.org.codehaus.plexus.archiver.zip.AbstractZipArchiver.createArchiveMain(AbstractZipArchiver.java:378)
        at org.apache.maven.surefire.shaded.org.codehaus.plexus.archiver.zip.AbstractZipArchiver.createArchive(AbstractZipArchiver.java:250)
        at org.apache.maven.surefire.booter.ForkConfiguration.createJar(ForkConfiguration.java:264)
[snip]
Caused by: java.lang.RuntimeException: class org.codehaus.plexus.archiver.zip.AsiExtraField doesn't implement ZipExtraField
        at org.apache.maven.surefire.shaded.org.codehaus.plexus.archiver.zip.ExtraFieldUtils.register(ExtraFieldUtils.java:63)
        at org.apache.maven.surefire.shaded.org.codehaus.plexus.archiver.zip.ExtraFieldUtils.<clinit>(ExtraFieldUtils.java:43)
        ... 31 more


My decompiler (DJ) shows that the interfaces were partially but not entirely shaded correctly:

package org.apache.maven.surefire.shaded.org.codehaus.plexus.archiver.zip;

import java.util.zip.CRC32;
import java.util.zip.ZipException;
import org.codehaus.plexus.archiver.UnixStat;
import org.codehaus.plexus.archiver.zip.ZipExtraField;
import org.codehaus.plexus.archiver.zip.ZipLong;
import org.codehaus.plexus.archiver.zip.ZipShort;

// Referenced classes of package org.apache.maven.surefire.shaded.org.codehaus.plexus.archiver.zip:
//            ZipExtraField, ZipShort, ZipLong

public class AsiExtraField
    implements org.apache.maven.surefire.shaded.org.codehaus.plexus.archiver.zip.ZipExtraField, org.apache.maven.surefire.shaded.org.codehaus.plexus.archiver.UnixStat, Cloneable
{

[...]

}

  was:
I tried using the shade plugin with surefire, to shade plexus-archiver.  It took several tries due to MSHADE-5, but even when it finally "worked", it failed to shade plexus-archiver correctly.

org.codehaus.plexus.archiver.zip.AsiExtraField implements org.codehaus.plexus.archiver.zip.ZipExtraField.  But when I try to run p-archiver after shading it, I get this exception:

java.lang.ExceptionInInitializerError
        at org.apache.maven.surefire.shaded.org.codehaus.plexus.archiver.zip.ZipEntry.getCentralDirectoryExtra(ZipEntry.java:386)
        at org.apache.maven.surefire.shaded.org.codehaus.plexus.archiver.zip.ZipOutputStream.writeCentralFileHeader(ZipOutputStream.java:769)
        at org.apache.maven.surefire.shaded.org.codehaus.plexus.archiver.zip.ZipOutputStream.finish(ZipOutputStream.java:320)
        at org.apache.maven.surefire.shaded.org.codehaus.plexus.archiver.zip.ZipOutputStream.close(ZipOutputStream.java:542)
        at org.apache.maven.surefire.shaded.org.codehaus.plexus.archiver.zip.AbstractZipArchiver.createArchiveMain(AbstractZipArchiver.java:378)
        at org.apache.maven.surefire.shaded.org.codehaus.plexus.archiver.zip.AbstractZipArchiver.createArchive(AbstractZipArchiver.java:250)
        at org.apache.maven.surefire.booter.ForkConfiguration.createJar(ForkConfiguration.java:264)
[snip]
Caused by: java.lang.RuntimeException: class org.codehaus.plexus.archiver.zip.AsiExtraField doesn't implement ZipExtraField
        at org.apache.maven.surefire.shaded.org.codehaus.plexus.archiver.zip.ExtraFieldUtils.register(ExtraFieldUtils.java:63)
        at org.apache.maven.surefire.shaded.org.codehaus.plexus.archiver.zip.ExtraFieldUtils.<clinit>(ExtraFieldUtils.java:43)
        ... 31 more


My decompiler (DJ) shows that the interfaces were partially but not entirely shaded correctly:

package org.apache.maven.surefire.shaded.org.codehaus.plexus.archiver.zip;

import java.util.zip.CRC32;
import java.util.zip.ZipException;
import org.codehaus.plexus.archiver.UnixStat;
import org.codehaus.plexus.archiver.zip.ZipExtraField;
import org.codehaus.plexus.archiver.zip.ZipLong;
import org.codehaus.plexus.archiver.zip.ZipShort;

// Referenced classes of package org.apache.maven.surefire.shaded.org.codehaus.plexus.archiver.zip:
//            ZipExtraField, ZipShort, ZipLong

public class AsiExtraField
    implements org.apache.maven.surefire.shaded.org.codehaus.plexus.archiver.zip.ZipExtraField, org.apache.maven.surefire.shaded.org.codehaus.plexus.archiver.UnixStat, Cloneable
{

[...]

}

        Summary: failure to shade/relocate plexus-archiver (interfaces not properly relocated)  (was: failure to shade plexus-archiver (interfaces not properly shaded))

Updated to clarify that this is a relocation bug

> failure to shade/relocate plexus-archiver (interfaces not properly relocated)
> -----------------------------------------------------------------------------
>
>                 Key: MSHADE-9
>                 URL: http://jira.codehaus.org/browse/MSHADE-9
>             Project: Maven 2.x Shade Plugin
>          Issue Type: Bug
>            Reporter: Dan Fabulich
>            Priority: Blocker
>
> I tried using the shade plugin with surefire, to shade/relocate plexus-archiver.  I'm trying to relocate its package to be org.apache.maven.surefire.shaded.org.codehaus.plexus.archiver.  It took several tries due to MSHADE-5, but even when it finally "worked", it failed to modify plexus-archiver correctly.
> org.codehaus.plexus.archiver.zip.AsiExtraField implements org.codehaus.plexus.archiver.zip.ZipExtraField.  But when I try to run p-archiver after shading it, I get this exception:
> java.lang.ExceptionInInitializerError
>         at org.apache.maven.surefire.shaded.org.codehaus.plexus.archiver.zip.ZipEntry.getCentralDirectoryExtra(ZipEntry.java:386)
>         at org.apache.maven.surefire.shaded.org.codehaus.plexus.archiver.zip.ZipOutputStream.writeCentralFileHeader(ZipOutputStream.java:769)
>         at org.apache.maven.surefire.shaded.org.codehaus.plexus.archiver.zip.ZipOutputStream.finish(ZipOutputStream.java:320)
>         at org.apache.maven.surefire.shaded.org.codehaus.plexus.archiver.zip.ZipOutputStream.close(ZipOutputStream.java:542)
>         at org.apache.maven.surefire.shaded.org.codehaus.plexus.archiver.zip.AbstractZipArchiver.createArchiveMain(AbstractZipArchiver.java:378)
>         at org.apache.maven.surefire.shaded.org.codehaus.plexus.archiver.zip.AbstractZipArchiver.createArchive(AbstractZipArchiver.java:250)
>         at org.apache.maven.surefire.booter.ForkConfiguration.createJar(ForkConfiguration.java:264)
> [snip]
> Caused by: java.lang.RuntimeException: class org.codehaus.plexus.archiver.zip.AsiExtraField doesn't implement ZipExtraField
>         at org.apache.maven.surefire.shaded.org.codehaus.plexus.archiver.zip.ExtraFieldUtils.register(ExtraFieldUtils.java:63)
>         at org.apache.maven.surefire.shaded.org.codehaus.plexus.archiver.zip.ExtraFieldUtils.<clinit>(ExtraFieldUtils.java:43)
>         ... 31 more
> My decompiler (DJ) shows that the interfaces were partially but not entirely shaded correctly:
> package org.apache.maven.surefire.shaded.org.codehaus.plexus.archiver.zip;
> import java.util.zip.CRC32;
> import java.util.zip.ZipException;
> import org.codehaus.plexus.archiver.UnixStat;
> import org.codehaus.plexus.archiver.zip.ZipExtraField;
> import org.codehaus.plexus.archiver.zip.ZipLong;
> import org.codehaus.plexus.archiver.zip.ZipShort;
> // Referenced classes of package org.apache.maven.surefire.shaded.org.codehaus.plexus.archiver.zip:
> //            ZipExtraField, ZipShort, ZipLong
> public class AsiExtraField
>     implements org.apache.maven.surefire.shaded.org.codehaus.plexus.archiver.zip.ZipExtraField, org.apache.maven.surefire.shaded.org.codehaus.plexus.archiver.UnixStat, Cloneable
> {
> [...]
> }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira