Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiled module descriptor in shadow-2.0.2.jar #352

Closed
sormuras opened this issue Dec 16, 2017 · 6 comments
Closed

Compiled module descriptor in shadow-2.0.2.jar #352

sormuras opened this issue Dec 16, 2017 · 6 comments
Milestone

Comments

@sormuras
Copy link
Contributor

sormuras commented Dec 16, 2017

shadow-2.0.2.jar contains the module-info.class from ASM project. It reports:

  • org.objectweb.asm.commons (6.0)

as its name to the Java module system. Compiled module desriptors from other artifacts should not be present.

jar --describe-module reports:

[email protected] jar:file:///[...]shadow-2.0.2.jar/!module-info.class open
exports shadow.org.objectweb.asm.commons
requires java.base mandated
requires org.objectweb.asm transitive
requires org.objectweb.asm.tree transitive
@johnrengelman
Copy link
Collaborator

This is a Java 9 thing right?
I'm thinking we need to auto-configure Shadow to exclude module-info.class from dependencies.

@sormuras
Copy link
Contributor Author

Sounds reasonable.

@swankjesse
Copy link

FYI, I tried to use exclude to exclude module-info.class but it didn’t work. Perhaps class files are special?

task shadedJar(type: ShadowJar) {
  classifier = null
  manifest.attributes 'Main-Class': 'com.squareup.exemplar.ExemplarServiceKt'

  from(project.convention.getPlugin(JavaPluginConvention).sourceSets.main.output)
  configurations = [project.configurations.runtime]
  exclude('META-INF/INDEX.LIST', 'META-INF/*.SF', 'META-INF/*.DSA', 'META-INF/*.RSA', 'module-info.class')
}

@johnrengelman
Copy link
Collaborator

Hmm, that should work. Theres nothing special about the file types for the exclude filter.

@swankjesse
Copy link

@johnrengelman it was my fault. In my project we defined a shadedJar task and I was executing the shadowJar task, which wasn’t honoring any of my customizations.

@johnrengelman
Copy link
Collaborator

Added this in 275382c

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants