2017-07-20 62 views
-1

Hai我是Resteasy的新手,我使用gradle爲應用程序引擎應用程序開發了resteasy,我正在使用Intellij IDE,這裏我使用的是依賴關係中的最新版本,無法使用Intellij中的Resteasy解決其他項目配置

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 
+0

您是否嘗試在您的gradle構建文件中包含編譯「commons-codec:commons-codec:1.9」? –

+0

不,我沒有,@MichaelMeyer – Prakash

+0

你會嘗試嗎? –

回答

1

你運行在代理構建?在這種情況下,您無法直接訪問maven central,您需要根據此doc相應地設置您的代理設置。 Gradle論壇here上討論了類似的錯誤和解決方案。

相關問題