[jira] Created: (MSHADE-9) failure to shade plexus-archiver (interfaces not properly shaded)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

[jira] Created: (MSHADE-9) failure to shade plexus-archiver (interfaces not properly shaded)

JIRA jira@codehaus.org
failure to shade plexus-archiver (interfaces not properly shaded)
-----------------------------------------------------------------

                 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 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
{

[...]

}

--
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

       
Reply | Threaded
Open this post in threaded view
|

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

JIRA jira@codehaus.org

     [ 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

       
Reply | Threaded
Open this post in threaded view
|

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

JIRA jira@codehaus.org
In reply to this post by JIRA jira@codehaus.org

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

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

    Attachment: mshade9-repro.diff

You should be able to apply this patch to surefire trunk revision 602310 to reproduce the problem.

> 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
>         Attachments: mshade9-repro.diff
>
>
> 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

       
Reply | Threaded
Open this post in threaded view
|

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

JIRA jira@codehaus.org
In reply to this post by JIRA jira@codehaus.org

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

Mauro Talevi updated MSHADE-9:
------------------------------

    Affects Version/s: 1.0-alpha-15
        Fix Version/s: 1.0-beta-1

> 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
>    Affects Versions: 1.0-alpha-15
>            Reporter: Dan Fabulich
>            Priority: Blocker
>             Fix For: 1.0-beta-1
>
>         Attachments: mshade9-repro.diff
>
>
> 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

       
Reply | Threaded
Open this post in threaded view
|

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

JIRA jira@codehaus.org
In reply to this post by JIRA jira@codehaus.org

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

Daniel Kulp commented on MSHADE-9:
----------------------------------


Question: does this actually cause a problem using the shaded classes?

If you look at the rest of the decompiled class, every reference to UnixStat,ZipLong, ZipShort,  ZipExtraField are fully qualified.  It LOOKS like ASM is leaving some extra class refs in the constant pool, but those classes aren't ever actually referenced in the methods/fields.

To kind of test it, I created a simple test program that created a "new AsiExtraField" and called a few things on it and everything seemed to work without any of the plexus stuff available. (except the shaded jar)

> 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
>    Affects Versions: 1.0-alpha-15
>            Reporter: Dan Fabulich
>            Priority: Blocker
>             Fix For: 1.0-beta-2
>
>         Attachments: mshade9-repro.diff
>
>
> 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

       
Reply | Threaded
Open this post in threaded view
|

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

JIRA jira@codehaus.org
In reply to this post by JIRA jira@codehaus.org

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

Brett Porter closed MSHADE-9.
-----------------------------

         Assignee: Brett Porter
       Resolution: Cannot Reproduce
    Fix Version/s:     (was: 1.0-beta-2)
                   1.0-beta-1

cannot reproduce against 1.0-beta-1

I went back to the old surefire that used archiver and tried this, getting this from javap:
Compiled from "AsiExtraField.java"
public class org.apache.maven.surefire.booter.shade.org.codehaus.plexus.archiver.zip.AsiExtraField extends java.lang.Object implements org.apache.maven.surefire.booter.shade.org.codehaus.plexus.archiver.zip.ZipExtraField,org.apache.maven.surefire.booter.shade.org.codehaus.plexus.archiver.UnixStat,java.lang.Cloneable{


> 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
>    Affects Versions: 1.0-alpha-15
>            Reporter: Dan Fabulich
>            Assignee: Brett Porter
>            Priority: Blocker
>             Fix For: 1.0-beta-1
>
>         Attachments: mshade9-repro.diff
>
>
> 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