[MSHADE-215] Shade plugin fails to handle "exploded" jars

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

[MSHADE-215] Shade plugin fails to handle "exploded" jars

Johno Crawford
Hey all,

When building the Atomix project on GitLab CI [1] we are running into the
same problem as described here
https://issues.apache.org/jira/browse/MSHADE-215

Essentially the artifacts passed into the shade plugin point to the modules
classes directory which fails [2] as the plugin expects jars.

Should the shade plugin be updated to support "exploded" jars? Can we
ignore directories [3]? Should Maven be returning files pointing to
directories in the first place?

[1]
https://github.com/atomix/atomix/pull/721
Apache Maven 3.5.4
Java version: 1.8.0_171
OS name: "linux", version: "4.14.48-coreos-r2", arch: "amd64"

[2]

Caused by: java.io.FileNotFoundException:
/builds/atomix-io/atomix/core/target/classes (Is a directory)
    at java.util.zip.ZipFile.open (Native Method)
    at java.util.zip.ZipFile.<init> (ZipFile.java:225)
    at java.util.zip.ZipFile.<init> (ZipFile.java:155)
    at java.util.jar.JarFile.<init> (JarFile.java:166)
    at java.util.jar.JarFile.<init> (JarFile.java:130)
    at org.apache.maven.plugins.shade.DefaultShader.newJarFile
(DefaultShader.java:371)
    at org.apache.maven.plugins.shade.DefaultShader.goThroughAllJarEntriesForManifestTransformer
(DefaultShader.java:281)
    at org.apache.maven.plugins.shade.DefaultShader.shade
(DefaultShader.java:100)
    at org.apache.maven.plugins.shade.mojo.ShadeMojo.execute
(ShadeMojo.java:442)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo
(DefaultBuildPluginManager.java:134)


[3]
https://github.com/johnou/maven-shade-plugin/commit/e9fb7f07b38710ebbd71c7993e04ff4fad4aa613

Cheers,

Johno
Reply | Threaded
Open this post in threaded view
|

Re: [MSHADE-215] Shade plugin fails to handle "exploded" jars

Johno Crawford
On 2018/07/21 11:05:29, Johno Crawford <[hidden email]> wrote:
> Hey all,>
>
> When building the Atomix project on GitLab CI [1] we are running into
the>
> same problem as described here>
> https://issues.apache.org/jira/browse/MSHADE-215>
>
> Essentially the artifacts passed into the shade plugin point to the
modules>

> classes directory which fails [2] as the plugin expects jars.>
>
> Should the shade plugin be updated to support "exploded" jars? Can we>
> ignore directories [3]? Should Maven be returning files pointing to>
> directories in the first place?>
>
> [1]>
> https://github.com/atomix/atomix/pull/721>
> Apache Maven 3.5.4>
> Java version: 1.8.0_171>
> OS name: "linux", version: "4.14.48-coreos-r2", arch: "amd64">
>
> [2]>
>
> Caused by: java.io.FileNotFoundException:>
> /builds/atomix-io/atomix/core/target/classes (Is a directory)>
>     at java.util.zip.ZipFile.open (Native Method)>
>     at java.util.zip.ZipFile.<init> (ZipFile.java:225)>
>     at java.util.zip.ZipFile.<init> (ZipFile.java:155)>
>     at java.util.jar.JarFile.<init> (JarFile.java:166)>
>     at java.util.jar.JarFile.<init> (JarFile.java:130)>
>     at org.apache.maven.plugins.shade.DefaultShader.newJarFile>
> (DefaultShader.java:371)>
>     at
org.apache.maven.plugins.shade.DefaultShader.goThroughAllJarEntriesForManifestTransformer>

> (DefaultShader.java:281)>
>     at org.apache.maven.plugins.shade.DefaultShader.shade>
> (DefaultShader.java:100)>
>     at org.apache.maven.plugins.shade.mojo.ShadeMojo.execute>
> (ShadeMojo.java:442)>
>     at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo>
> (DefaultBuildPluginManager.java:134)>
>
>
> [3]>
>
https://github.com/johnou/maven-shade-plugin/commit/e9fb7f07b38710ebbd71c7993e04ff4fad4aa613>

>
> Cheers,>
>
> Johno>
>

After downgrading Maven to 3.5.0 I am no longer able to reproduce the
problem.
Reply | Threaded
Open this post in threaded view
|

Re: [MSHADE-215] Shade plugin fails to handle "exploded" jars

Johno Crawford
On Sat, Jul 21, 2018 at 11:59 PM Johno Crawford <[hidden email]>
wrote:

> On 2018/07/21 11:05:29, Johno Crawford <[hidden email]> wrote:
> > Hey all,>
> >
> > When building the Atomix project on GitLab CI [1] we are running into
> the>
> > same problem as described here>
> > https://issues.apache.org/jira/browse/MSHADE-215>
> >
> > Essentially the artifacts passed into the shade plugin point to the
> modules>
> > classes directory which fails [2] as the plugin expects jars.>
> >
> > Should the shade plugin be updated to support "exploded" jars? Can we>
> > ignore directories [3]? Should Maven be returning files pointing to>
> > directories in the first place?>
> >
> > [1]>
> > https://github.com/atomix/atomix/pull/721>
> > Apache Maven 3.5.4>
> > Java version: 1.8.0_171>
> > OS name: "linux", version: "4.14.48-coreos-r2", arch: "amd64">
> >
> > [2]>
> >
> > Caused by: java.io.FileNotFoundException:>
> > /builds/atomix-io/atomix/core/target/classes (Is a directory)>
> >     at java.util.zip.ZipFile.open (Native Method)>
> >     at java.util.zip.ZipFile.<init> (ZipFile.java:225)>
> >     at java.util.zip.ZipFile.<init> (ZipFile.java:155)>
> >     at java.util.jar.JarFile.<init> (JarFile.java:166)>
> >     at java.util.jar.JarFile.<init> (JarFile.java:130)>
> >     at org.apache.maven.plugins.shade.DefaultShader.newJarFile>
> > (DefaultShader.java:371)>
> >     at
> org.apache.maven.plugins.shade.DefaultShader.goThroughAllJarEntriesForManifestTransformer>
>
> > (DefaultShader.java:281)>
> >     at org.apache.maven.plugins.shade.DefaultShader.shade>
> > (DefaultShader.java:100)>
> >     at org.apache.maven.plugins.shade.mojo.ShadeMojo.execute>
> > (ShadeMojo.java:442)>
> >     at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo>
> > (DefaultBuildPluginManager.java:134)>
> >
> >
> > [3]>
> >
> https://github.com/johnou/maven-shade-plugin/commit/e9fb7f07b38710ebbd71c7993e04ff4fad4aa613>
>
> >
> > Cheers,>
> >
> > Johno>
> >
>
> After downgrading Maven to 3.5.0 I am no longer able to reproduce the
> problem.
>

I created a new JIRA issue
https://issues.apache.org/jira/browse/MSHADE-295 because
when downgrading Apache Maven 3.5.4 to Apache Maven 3.5.0 the Shade plugin
works as expected.

Cheers,
--
Johno Crawford