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

Fat JAR is automatically published after upgrading from 5.2.0 → 6.0.0 #586

Open
bwaldvogel opened this issue Jul 5, 2020 · 6 comments

Comments

@bwaldvogel
Copy link

Shadow Version

6.0.0

Gradle Version

6.5.1

Expected Behavior

I’m publishing maven artifacts with the maven-publish plugin.
Fat JARs are not automatically published (until I configured it explicitly).

Actual Behavior

After upgrading from shadow 5.2.0 to 6.0.0 I see that the …-all.jar files are published.
Is the behavior change in 6.0.0 intended? If yes, how can I disable it?

Gradle Build Script(s)

https://github.com/bwaldvogel/mongo-java-server/blob/master/build.gradle

@bratkartoffel
Copy link

Same issue for me, haven't found a way to disable this new behavior.

@kisssadam
Copy link

I started to experience the same problem with an upgrade from 5.2.0 to 6.0.0.

@johnrengelman Can you please fix this issue or update the documentation on how to disable it and mention that this is now the default behavior?

@asardaes
Copy link

asardaes commented Oct 14, 2020

I think I found a way to exclude the shadow jar based on this, just add this to the build.gradle file of the published module:

components.java.withVariantsFromConfiguration(configurations.shadowRuntimeElements) {
    skip()
}

@kisssadam
Copy link

I think I found a way to exclude the shadow jar based on this, just add this to the build.gradle file of the published module:

components.java.withVariantsFromConfiguration(configurations.shadowRuntimeElements) {
    skip()
}

This is great, however the default behavior should be not to publish fat jars.

violetagg added a commit to reactor/reactor-netty that referenced this issue Oct 28, 2020
…ven repository

There is no need to add manually to the maven publications the artifact produced by shadowJar.
This is related to a change between version 5.2.0->6.0.0
GradleUp/shadow#586
@elect86
Copy link

elect86 commented Nov 4, 2021

For kotlin scripts:

// Skip fat jar publication
components.java.withVariantsFromConfiguration(configurations.shadowRuntimeElements.get()) { skip() }

val SoftwareComponentContainer.java
    get() = components.getByName("java") as AdhocComponentWithVariants

@mgroth0
Copy link

mgroth0 commented May 5, 2024

Just closed my issue #783 in favor of this one.

I just want to add so we don't forget that in addition to not including the fat jar in the publication, we also want to make sure that publication tasks to not depend on the shadowJar task (as they currently seem to do), since the shadowJar task is expensive.

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

6 participants