-
Notifications
You must be signed in to change notification settings - Fork 400
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
uploadX task fails if both shadow 2.0.x and application plugin are applied. #347
Comments
Reproduced here with Maven plugin's uploadArchives task, shadow 2.0.2 and Gradle 4.4.1 |
I think the |
Can't you reverse the logic of the plugin (shadow) then? And make the result of |
Running into the same issue. Any workaround here? |
We reverted to 1.2.4 for the time being, but be warned that this produces a warning with gradle 4.X about a private/internal constructor being kept for this plugin compatibility only and planned to be removed with Gradle 5. |
Hi @johnrengelman! Are you working on the issue or planning to do so in the nearest future? |
Any news about this? I have to stay on 1.2.4 because of it but that version of the plugin won't work anymore with Gradle 5.0, i.e. the next Gradle version. Warning produced by Gradle 4.10 with
|
Just for the record: |
@huxi what is the actual intended outcome here. What should be uploaded by the |
@johnrengelman Primarily, it should behave like This is completely unrelated to anything that actually happens while shadowing (the above example doesn't even have dependencies or any class file at all). Something must have changed between There seems to be some collision between the |
yeah, but I need to write a test and verify what's happening. A LOT changed between those version, thus the major version change. |
Ok, I believe I see what's happening. According to https://docs.gradle.org/current/userguide/distribution_plugin.html#sec:publishing_distributions_upload ALL distributions are automatically added to the default You can work around this in your build by adding the following:
|
Hm... I'm not sure about the intended behavior of 2.0.0 since it never worked for me. Your latest reply just popped up. Are shadowDistZip/Tar new in shadow 2.0.0? Can I somehow disable them altogether because distZip/Tar of the I'll give your workaround a shot (thanks!) but I think a better default handling of the |
I'll add default handling, but yeah, this isn't something I can control directly. It's the behavior of the |
Thanks a lot for your effort. Your suggested workaround works. Just tried it. 👍 |
Summary: GradleUp/shadow#347 > Task :release FAILED Release process failed, reverting back any changes made by Release Plugin. Release process failed, reverting back any changes made by Release Plugin. FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':ugb:ugb:uploadArchives'. > Could not publish configuration 'archives' > A POM cannot have multiple artifacts with the same type and classifier. Already have MavenArtifact ugb:zip:zip:null, trying to add MavenArtifact ugb:zip:zip:null. Reviewers: dbolcion Differential Revision: https://code.uberinternal.com/D2378221
@johnrengelman I'm currently facing an issue on Gradle 6.1.1 / Shadow 5.2.0 (and earlier version all the way to 4.0.4) (which, for context here, runs maven within gradle (using gradle-maven-exec-plugin) in order to resolve certain company-specific internal dependencies which CANNOT be resolved by gradle, as they require a special maven build extension. These dependencies are then read from mavenLocal() by gradle) This results in the following when trying to gradle jar / gradle assemble / gradle build (even tasks which EXCLUDE shadowJar completely) Could not determine the dependencies of task ':shadowJar'.
I use the maven-publish plugin to create maven releases for this project. While trying to find out why the shadowJar task has the above behavior, I ran into the following on your shadow github release page: https://github.com/johnrengelman/shadow/releases/tag/4.0.4 "When using shadow, application, and maven plugins together, remove shadowDistZip and shadowDistTar from I commented out the maven-publish plugin, and instead applied the (now deprecated https://docs.gradle.org/current/userguide/maven_plugin.html) maven plugin, and sure enough, build magically started working. The reason as to why that is boggles my mind. Right now the work-around to my problem is to apply the maven-publish plugin and configure my maven release that way, and also apply the deprecated maven plugin, which is the deprecated version of maven-publish, and could possibly cause conflicts when publishing. TL;DR, could you please apply whatever fix you made in conjunction with the maven plugin, also to the maven-publish plugin? Let me know if you want a separate issue for this. I felt this was the most appropriate place to ask. |
Shadow Version
1.2.4 vs. 2.0.0/2.0.1
Gradle Version
4.3.1/4.4-rc1
Expected Behavior
This example project (
build.gradle
is also provided below) should work with 2.0.x since it worked with 1.2.4.Execute
gradlew
to run the default tasks.Actual Behavior
If you remove the following two lines, the build will work.
If you instead switch back from 2.0.1 to 1.2.4, the build will work.
If you use Gradle 4.4-rc1, neither will work. See gradle/gradle#3589
Gradle Build Script(s)
Content of Shadow JAR (
jar tf <jar file>
- post link to GIST if too long)n/a, content of the JAR is not the problem.
The text was updated successfully, but these errors were encountered: