gpt4 book ai didi

java - 如何修复此 Xlint :path error when using Gradle, JUNG 和容易出错的问题?

转载 作者:太空宇宙 更新时间:2023-11-04 12:09:00 27 4
gpt4 key购买 nike

我很难让 JUNG 和 Error Prone 在我的基于 Gradle 的 Java 项目中很好地协同工作,我想知道是否有人以前遇到过这样的问题并可以帮助我找到解决方案。

我已经在 JUNG 的 GitHub 问题跟踪器上发布了此问题和 Error Prone ,但似乎没有人知道其原因是什么,这就是我将其发布在这里的原因。

When I try to run gradle run with the following build.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, the META-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 lines id 'net.ltgt.errorprone' version '0.0.8' and errorprone '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.

我认为值得注意的是,自从我在 JUNG 问题跟踪器上发布了上述问题后,我将项目的 Error Prone 版本从 2.0.11 升级到 2.0.13,但不幸的是,这并没有解决我的问题。

最佳答案

问题自 this bug fix to JUNG 起已解决.

关于java - 如何修复此 Xlint :path error when using Gradle, JUNG 和容易出错的问题?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40050098/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com