2016-04-14 5 views
0

./gradlew cleanでプロジェクトをクリーンアップしようとしても、 ./gradlew buildが機能しません。いくつかのリポジトリを試しましたが、Springの依存関係を解決できません。ここでGradlewビルドが動作しない

build.gradleです:

apply plugin: 'war' 

war { 
    baseName = 'hello' 
} 

configurations { 
    providedRuntime 
} 

dependencies { 

    compile('org.springframework.boot:spring-boot-starter-web') 
    compile('org.json:json:20141113') 
    compile('com.jayway.jsonpath:json-path:0.8.1') 
    compile('org.jsoup:jsoup:1.8.2') 
    compile('org.springframework.social:spring-social-twitter') 
    compile('org.springframework.social:spring-social-twitter:1.1.0.RELEASE') 
    compile('org.springframework.social:spring-social-core') 
    providedRuntime('org.springframework.boot:spring-boot-starter-tomcat') 
    testCompile('org.springframework.boot:spring-boot-starter-test') 
} 

repositories { 
     mavenCentral() 
} 

そして、ここで例外:

* What went wrong: 
Could not resolve all dependencies for configuration ':compile'. 
> Cannot resolve external dependency org.springframework.boot:spring-boot-starter-web: because no repositories are defined. 
    Required by: 
     :hello:unspecified 
> Cannot resolve external dependency org.json:json:20141113 because no repositories are defined. 
    Required by: 
     :hello:unspecified 
> Cannot resolve external dependency com.jayway.jsonpath:json-path:0.8.1 because no repositories are defined. 
    Required by: 
     :hello:unspecified 
> Cannot resolve external dependency org.jsoup:jsoup:1.8.2 because no repositories are defined. 
    Required by: 
     :hello:unspecified 
> Cannot resolve external dependency org.springframework.social:spring-social-twitter:1.1.0.RELEASE because no repositories are defined. 
    Required by: 
     :hello:unspecified 
> Cannot resolve external dependency org.springframework.social:spring-social-twitter:1.1.0.RELEASE because no repositories are defined. 
    Required by: 
     :hello:unspecified 
> Cannot resolve external dependency org.springframework.social:spring-social-core: because no repositories are defined. 
    Required by: 
     :hello:unspecified 

私はMavenのレポは十分にあると思ったが、それは私もjcenter()でそれを試してみました失敗し続けています。私はubuntu 14.04 VMで作業しています。

は解決:

マイケルは私は依存関係のバージョンを追加する必要がありましたコメントで言ったように:

compile('org.springframework.boot:spring-boot-starter-web') 
compile('org.springframework.boot:spring-boot-starter-web:1.3.3.RELEASE') 
+0

依存関係の前にリポジトリを宣言してみましたか? – Michael

+0

はい、この例外があります: 'org.springframework.bootを見つけることができませんでした:sp​​ring-boot-starter-web' – julien

+0

管理依存関係を動作させるためにSpringブートGradleプラグインを適用する必要があります。詳細については、Spring Boot Gradleの例を参照してください。 – cjstehno

答えて

1

まず、依存関係の前にリポジトリを宣言します。前者はバージョンが含まれていないため、そして第二に、

compile('org.springframework.boot:spring-boot-starter-web:1.3.3.RELEASE') 

compile('org.springframework.boot:spring-boot-starter-web') 

を交換してください。