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

UnusedTracker produces path may not be null or empty string. path='null' #425

Closed
sormuras opened this issue Nov 11, 2018 · 11 comments
Closed
Milestone

Comments

@sormuras
Copy link
Contributor

OpenJDK 11, Shadow 4.0.2, Gradle 4.10.2

Full stacktrace at https://scans.gradle.com/s/gubxbmanlcctc/failure?openFailures=WzBd&openStackTraces=WzEse31d#top=0 which contains the line at com.github.jengelman.gradle.plugins.shadow.internal.UnusedTracker$_getApiJarsFromProject_closure5.doCall(UnusedTracker.groovy:59).

@sormuras
Copy link
Contributor Author

@sormuras
Copy link
Contributor Author

Going back to Shadow 4.0.1 solves the problem.

sormuras added a commit to junit-team/junit5 that referenced this issue Nov 11, 2018
@johnrengelman johnrengelman added this to the 4.0.4 milestone Nov 22, 2018
@marcphilipp
Copy link
Contributor

I'm afraid this still happens with 4.0.4:
https://scans.gradle.com/s/ewzybqosj4nyg/failure?openFailures=WzBd&openStackTraces=WzFd#top=0

@fcurts
Copy link

fcurts commented Jan 22, 2019

Same here: 4.0.4 doesn't work, 4.0.1 does.

@marcphilipp
Copy link
Contributor

@johnrengelman Shall we create a new issue or do you want to reopen this one?

@gabizou
Copy link

gabizou commented Feb 25, 2019

Having just encountered this in a rather complicated multi-project setup, I've found that if in an all projects configuration or similar, having ParentProjectA being api(project(":parentProjectA")) on ProjectB, and in ProjectB's build.gradle

projectB = this
subprojects {
    dependencies {
        api(projectB)
    }
}

will end up causing :projectB to have a null path. I'm not 100% positive how specifically that is reproduced or whether that explanation is enough to reproduce the issue, but I'll be commenting back again once I do have a replicatable gradle setup in the next day or two.

@dealy663-zz
Copy link

I am also having this same problem with my build since I went to Gradle 5.x.

Reverting the shadow plugin back to 4.0.1 seems to have fixed it for now.

@marcphilipp
Copy link
Contributor

Could someone create a sample project to reproduce the problem and create a new issue?

@swankjesse
Copy link

I ran into this on 5.0.

In my multi-project build UnusedTracker.getApiJarsFromProject() attempts to get the .jar file for other projects like so:

apiJars.add(runtimeConfiguration.find { it.name.endsWith("${dep.name}.jar") } as File)

This doesn’t work. In my project dep.name is okhttp but the jar it’s trying to find ends with okhttp-3.15-SNAPSHOT.jar. So the find() call returns null. Once null is in apiJars that collection is poisoned, and later attempts to access it throw the exception above.

@sormuras
Copy link
Contributor Author

sormuras commented Apr 2, 2019

As @swankjesse said, shadow 5.0.0 suffers the same issue. We (JUnit) need to upgrade to 5.0.0 as we need Java 11 support, thus staying on 4.0.1 is no longer an option for us.

@johnrengelman Does the hint Jesse gave help?

@sormuras
Copy link
Contributor Author

sormuras commented Apr 2, 2019

Is it possible to disable the UnusedTracker via configuration?

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

7 participants