Xlint:path error with JUNG, Gradle and Error Prone
See original GitHub issueHi Error Prone team.
This is an issue which I posted already on https://github.com/jrtom/jung/issues/66. @jrtom seems to be at a loss as to what’s causing it, so I wonder if someone on the Error Prone team can help me.
I’ve pasted the original issue text below so that people don’t have to follow the link to read it.
When I try to run
gradle run
with the followingbuild.gradle
plugins { id 'application' id 'java' id 'net.ltgt.errorprone' version '0.0.8' } group 'org.jbduncan' version '1.0-SNAPSHOT' sourceCompatibility = 1.8 mainClassName = 'org.jbduncan.helloworld.HelloWorld' repositories { jcenter() } dependencies { compile 'net.sf.jung:jung-graph-impl:2.1.1' errorprone 'com.google.errorprone:error_prone_core:2.0.11' } tasks.withType(JavaCompile) { options.encoding = 'UTF-8' options.compilerArgs = [ '-Xlint:all', '-Werror' ] }
and this class
package org.jbduncan.helloworld; public final class HelloWorld { public static void main(String[] args) { System.out.println("Hello, world!"); } }
it emits the following message.
:compileJava warning: [path] bad path element "C:\Users\Jonathan\.gradle\caches\modules-2\files-2.1\net.sf.jung\jung-graph-impl\2.1.1\8293acb2ab4c00a3939cb99a8751e5d38a4299dc\jung-api-2.1.1.jar": no such file or directory warning: [path] bad path element "C:\Users\Jonathan\.gradle\caches\modules-2\files-2.1\net.sf.jung\jung-graph-impl\2.1.1\8293acb2ab4c00a3939cb99a8751e5d38a4299dc\guava-19.0.jar": no such file or directory warning: [path] bad path element "C:\Users\Jonathan\.gradle\caches\modules-2\files-2.1\net.sf.jung\jung-api\2.1.1\e47ee4efdfacce12f0af620747d9d0e44bf2eaa4\guava-19.0.jar": no such file or directory error: warnings found and -Werror specified 1 error 3 warnings :compileJava FAILED FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':compileJava'. > Compilation failed with exit code 1; see the compiler error output for details. * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. BUILD FAILED Total time: 5.488 secs
When I investigate the contents of my Gradle cache, I can see that, indeed, the jar files mentioned above simply don’t exist.
When I look into
C:\Users\Jonathan\.gradle\caches\modules-2\files-2.1\net.sf.jung\jung-graph-impl\2.1.1\8293acb2ab4c00a3939cb99a8751e5d38a4299dc\jung-graph-impl-2.1.1.jar
, theMETA-INF/MANIFEST.MF
contains this text.Manifest-Version: 1.0 Archiver-Version: Plexus Archiver Created-By: Apache Maven 3.0.5 Built-By: jrtom Build-Jdk: 1.8.0-google-v7 Class-Path: jung-api-2.1.1.jar guava-19.0.jar
I get the same problem with JUNG versions 2.1 and 2.0, and no other library with dependencies I’ve tried seems to have this problem.
However the problem goes away when I exclude from
build.gradle
the linesid 'net.ltgt.errorprone' version '0.0.8'
anderrorprone 'com.google.errorprone:error_prone_core:2.0.11'
, so it’s not clear to me if this is a problem with JUNG or if it’s gradle-errorprone-plugin or Error Prone related.
(Since writing the original issue, I upgraded from Error Prone 2.0.11 to 2.0.13, but that didn’t seem to solve my problem.)
Issue Analytics
- State:
- Created 7 years ago
- Comments:9 (6 by maintainers)
Top GitHub Comments
I don’t think there’s a gradle bug here beyond the underlying JSR 199 bug.
I suggest having JUNG not set
Class-Path
in the jar’s manifest. Removing<addClasspath>
from the pom should do it: https://github.com/jrtom/jung/blob/6c0a8e568a2215c15a8195f3ec75321f6241ce48/pom.xml#L152Thank you everyone, @cushon and @tbroyer included. It seems it was a bug in how the JUNG jar was being built, which I’ve submitted a fix for, so I’m closing this issue for now.
@cushon, on a related note, have you received any news regarding the bug in JSR 199 which you queried about at http://mail.openjdk.java.net/pipermail/compiler-dev/2016-October/010455.html?