2017-05-03 19 views
0

ためGradleの依存関係を含めながら、これは私のbuild.gradleファイルトラブルはzuul

buildscript { 
    ext { 
     springBootVersion = '1.4.2.RELEASE' 
    } 
    repositories { 
     mavenCentral() 
    } 
    dependencies { 
     classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}") 
    } 
} 

apply plugin: 'java' 
apply plugin: 'eclipse' 
apply plugin: 'org.springframework.boot' 

jar { 
    baseName = 'yBayApplication' 
    version = '0.0.1-SNAPSHOT' 
} 
sourceCompatibility = 1.8 
targetCompatibility = 1.8 

repositories { 
    mavenCentral() 
    maven { url "https://repo.spring.io/snapshot" } 
    maven { url "https://repo.spring.io/milestone" } 
} 

springBoot { 
    mainClass = "com.ybayApplication.customerAccount.CustomerServiceApplication" 
} 

dependencies { 
    compile('org.springframework.cloud:spring-cloud-starter-eureka-server:1.2.3.RELEASE') 
    compile('org.springframework.cloud:spring-cloud-starter-zuul') 
    compile group: 'com.netflix.zuul', name: 'zuul-core', version: '2.0.0-rc.1' 
    compile group: 'com.netflix.governator', name: 'governator-archaius', version: '1.6.0' 
    compile group: 'io.reactivex', name: 'rxjava-string', version: '0.22.0' 
    compile('org.springframework.boot:spring-boot-starter-actuator') 
    compile('org.springframework.boot:spring-boot-starter-web') 
    testCompile('org.springframework.boot:spring-boot-starter-test') 
    compile("org.springframework.boot:spring-boot-starter-data-jpa") 
    compile("com.h2database:h2") 
    testCompile("junit:junit") 
} 

dependencyManagement { 
    imports { 
     mavenBom "org.springframework.cloud:spring-cloud-dependencies:Brixton.BUILD-SNAPSHOT" 
    } 
} 


eclipse { 
    classpath { 
     containers.remove('org.eclipse.jdt.launching.JRE_CONTAINER') 
     containers 'org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8' 
    } 
} 

であり、これはGradleのを構築しながら、私が受けていますエラーメッセージです。

Gradle Distribution: Local installation at C:\gradle\gradle-3.4.1 
Gradle Version: 3.4.1 
Java Home: C:\Program Files (x86)\Java\jdk1.8.0_121 
JVM Arguments: None 
Program Arguments: None 
Gradle Tasks: clean build 

:clean UP-TO-DATE 
:compileJava FAILED 

FAILURE: Build failed with an exception. 

* What went wrong: 
Could not resolve all dependencies for configuration ':detachedConfiguration5'. 
> Could not find com.netflix.governator:governator-archaius:1.6.0. 
    Searched in the following locations: 
     https://repo1.maven.org/maven2/com/netflix/governator/governator-archaius/1.6.0/governator-archaius-1.6.0.pom 
     https://repo1.maven.org/maven2/com/netflix/governator/governator-archaius/1.6.0/governator-archaius-1.6.0.jar 
     https://repo.spring.io/snapshot/com/netflix/governator/governator-archaius/1.6.0/governator-archaius-1.6.0.pom 
     https://repo.spring.io/snapshot/com/netflix/governator/governator-archaius/1.6.0/governator-archaius-1.6.0.jar 
     https://repo.spring.io/milestone/com/netflix/governator/governator-archaius/1.6.0/governator-archaius-1.6.0.pom 
     https://repo.spring.io/milestone/com/netflix/governator/governator-archaius/1.6.0/governator-archaius-1.6.0.jar 
    Required by: 
     project : 
     project : > com.netflix.zuul:zuul-core:2.0.0-rc.1 

* 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: 1.77 secs 

build.gradleファイルにあるように、不足している依存関係も追加しました。私はこの例を基にしたZuulフィルタをグラデルhttps://spring.io/guides/gs/routing-and-filtering/に実装しようとしています。初見で

答えて

1

あなたはそれをダウンロードするよう
compile group: 'com.netflix.zuul', name: 'zuul-core', version: '2.0.0-rc.1'

compile('org.springframework.cloud:spring-cloud-starter-zuul')がzuulコアに依存して削除する必要があるように、それが見えます。

さらに、governator-archaiusの場合、バージョン1.6.0は表示されません。 あなたは1.16.0を意味すると思います。正確なバージョンを入手するには、こちらのリンクをご覧ください。https://mvnrepository.com/artifact/com.netflix.governator/governator-archaius

これが問題を解決するかどうか教えてください。

+0

はい、それはトリックでした。しかし、私はまだ私が1.16.0ではなく、バージョン1.6.0としてエラーメッセージを受け取っていたのだろうと思っています。とにかく、ありがとう。 – Adithya

+0

@Adithyaバージョン1.6.0がないため、古いバージョンを削除した可能性があります。上記のリンクをクリックすると、最新のバージョンが1.7.1であるはずです。 –