java - 无法使用Intellij中的Resteasy解决其他项目配置

标签 java google-app-engine intellij-idea gradle resteasy

Hai,我是Resteasy的新手,我正在使用gradle来开发resteasy,用于应用程序引擎应用程序,我正在使用Intellij IDE,在这里我正在使用依赖项中的最新版本,

compile group: 'org.jboss.resteasy', name: 'resteasy-jaxrs', version: '3.0.23.Final'
compile group: 'org.jboss.resteasy', name: 'resteasy-jackson2-provider', version: '3.0.23.Final'

我遇到了错误,但是我使用的是旧版本,
compile group: 'org.jboss.resteasy', name: 'resteasy-jaxrs', version: '3.0.10.Final'
compile group: 'org.jboss.resteasy', name: 'resteasy-jackson2-provider', version: '3.0.10.Final'

该应用程序工作正常,但是我需要使用新版本,该如何解决?谁能解决这个问题?我的文件夹结构和build.gradle在下面给出

当我在依赖项中提到新版本时,有弹出窗口(如图所示)

enter image description here

我收到警告
Warning:<i><b>root project 'Sample': Unable to resolve additional project configuration.</b>
Details: org.gradle.api.internal.artifacts.ivyservice.DefaultLenientConfiguration$ArtifactResolveException: Could not resolve all files for configuration ':compileClasspath'.
Caused by: org.gradle.internal.resolve.ArtifactResolveException: Could not download commons-codec.jar (commons-codec:commons-codec:1.9)
Caused by: org.gradle.api.UncheckedIOException: Could not read entry '22da77b0d76ea8df17298218f3ec1f87:commons-codec.jar (commons-codec:commons-codec:1.9)' from cache artifact-at-repository.bin (C:\Users\user\.gradle\caches\modules-2\metadata-2.23\artifact-at-repository.bin).
Caused by: java.io.EOFException: null
Caused by: com.esotericsoftware.kryo.KryoException: Buffer underflow.</i>

当我尝试尝试任务appengineRun时,我得到的错误是,
    05:56:35 PM: Executing external task 'appengineRun'...
:compileJava FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Could not resolve all files for configuration ':compileClasspath'.
> Could not download commons-codec.jar (commons-codec:commons-codec:1.9)
   > Could not read entry '22da77b0d76ea8df17298218f3ec1f87:commons-codec.jar (commons-codec:commons-codec:1.9)' from cache artifact-at-repository.bin (C:\Users\user\.gradle\caches\modules-2\metadata-2.23\artifact-at-repository.bin).

* 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: 0.447 secs
Buffer underflow.
05:56:36 PM: External task execution finished 'appengineRun'.

enter image description here

build.gradle中:
buildscript {
    repositories {
        jcenter()
        mavenCentral()
    }
    dependencies {
        classpath 'com.google.cloud.tools:appengine-gradle-plugin:+'
    }
}

repositories {
    jcenter()
    mavenCentral()
}


apply plugin: 'java'
apply plugin: 'war'
apply plugin: 'com.google.cloud.tools.appengine'

dependencies {
    //working--//compile group: 'org.jboss.resteasy', name: 'resteasy-jaxrs', version: '3.0.10.Final'
    compile group: 'org.jboss.resteasy', name: 'resteasy-jaxrs', version: '3.1.3.Final'

    //working--//compile group: 'org.jboss.resteasy', name: 'resteasy-jackson2-provider', version: '3.0.10.Final'
    compile group: 'org.jboss.resteasy', name: 'resteasy-jackson2-provider', version: '3.1.3.Final'
    compile 'com.google.appengine:appengine:+'
}

appengine {
    run {
        port = 8080
    }

    deploy {
        stopPreviousVersion = true
        promote = true
    }
}

sourceCompatibility = 1.7
targetCompatibility = 1.7

最佳答案

您是否在代理后面运行构建?在这种情况下,您无权直接访问Maven Central,并且需要根据此doc相应地设置代理设置。在gradle论坛here上讨论了类似的错误和解决方案。

关于java - 无法使用Intellij中的Resteasy解决其他项目配置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45215526/

相关文章:

python - 无法在 appengine 数据存储区中存储数据

安卓后端 : Google App Engine vs Compute engine

gradle - 未找到模块化 java 模块

java - 如何在Intellij IDEA 15中用Tomcat8运行 "hello world"JSP页面?

scala - 运行 scala 控制台时出错。未找到模块

java - 在 Eclipse Oxygen 2 中设置 Tomcat 服务器

java - 删除Java String数组中的部分元素

java - GAE 上的持久性异常

java - 无法使用 zip4j 压缩文件

java - 在 Jar 文件中加载图像 java.lang.RuntimeException : Resource not found