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

Fails to create JAR with Gradle api dependencies #424

Closed
mjpt777 opened this issue Nov 7, 2018 · 5 comments
Closed

Fails to create JAR with Gradle api dependencies #424

mjpt777 opened this issue Nov 7, 2018 · 5 comments
Milestone

Comments

@mjpt777
Copy link

mjpt777 commented Nov 7, 2018

I get the following failure when trying to build Gradle api dependencies with 'java-library'.

> Task :sbe-all:shadowJar FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':sbe-all:shadowJar'.
> path may not be null or empty string. path='null'

Shadow Version

4.0.2.

Gradle Version

4.10.1.

Expected Behavior

Successfully create a JAR with shaded api dependencies.

Actual Behavior

Build fails.

Gradle Build Script(s)

Apply the attached patch to the following file and build.

https://github.com/real-logic/simple-binary-encoding/blob/master/build.gradle

java-library.zip

@JamesXNelson
Copy link
Contributor

I've debugged this down to "shadow borks when using task output dependencies anywhere on runtime classpath". If the dependency is a SelfResolvingDependency, the logic in com.github.jengelman.gradle.plugins.shadow.internal.UnusedTracker#getApiJarsFromProject is wrong.

Needs either a null check and throw there, where it actually helps to know what is causing null, or needs to handle (or ignore, with really loud warnings, maybe) the SelfResolvingDependency type.

@JamesXNelson
Copy link
Contributor

This issue should already be fixed w/ the merged code above.

jrodbx pushed a commit to square/wire that referenced this issue Mar 4, 2019
jrodbx pushed a commit to square/wire that referenced this issue Mar 5, 2019
@jrodbx
Copy link

jrodbx commented Mar 5, 2019

This issue still exists in 4.0.4 and Gradle 4.10.2. Downgrading to 4.0.1 solved the problem for me. @johnrengelman, should I file another issue or shall this ticket be reopened?

jrodbx pushed a commit to square/wire that referenced this issue Mar 5, 2019
@JamesXNelson
Copy link
Contributor

If the original test case fails, then reopen. If not, new issue.

@JamesXNelson
Copy link
Contributor

also, try to use gradle 4.10.3. Not sure if that's EOL for the 4.X line or not, but it's worth ruling out "anything except the newest patch version of the previous major version".

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

4 participants