[英]Trying to compile with gradle bootrun and get cannot find spring-boot-gradle-plugin:1.4.0.BUILD-SNAPSHOT
我在cmd提示窗口上使用“ gradle bootrun”運行gradle項目。
我得到的錯誤是這樣的:
無法解析配置':classpath'的所有工件。 找不到org.springframework.boot:spring-boot-gradle-plugin:1.4.0.BUILD-SNAPSHOT。 在以下位置搜索:
- https://repo.maven.apache.org/maven2/org/springframework/boot/spring-boot-gradle-plugin/1.4.0.BUILD-SNAPSHOT/maven-metadata.xml <-發生404錯誤到頁面
- https://repo.maven.apache.org/maven2/org/springframework/boot/spring-boot-gradle-plugin/1.4.0.BUILD-SNAPSHOT/spring-boot-gradle-plugin-1.4.0.BUILD- SNAPSHOT.pom <-轉到頁面時產生404錯誤
- https://repo.maven.apache.org/maven2/org/springframework/boot/spring-boot-gradle-plugin/1.4.0.BUILD-SNAPSHOT/spring-boot-gradle-plugin-1.4.0.BUILD- SNAPSHOT.jar <-轉到頁面時會產生404錯誤,要求:project:
************漸變*****************
所以這是我的build.gradle文件:
buildscript {
ext {
springBootVersion = '1.5.3.RELEASE'
}
repositories {
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:1.4.0.BUILD-SNAPSHOT") ***<-- THIS DOESN'T EXIST on repo.Spring.io. Only 1.2.0 = 5.x*** or ***<-- on repo.spring.io***
}
}
apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'eclipse'
apply plugin: 'spring-boot'
apply plugin: 'org.springframework.boot'
//apply plugin: 'war'
version = '0.0.1'
sourceCompatibility = 1.8
repositories {
jcenter()
mavenCentral()
flatDir {
dirs 'repository'
}
mavenCentral()
}
ext {
springCloudVersion = 'Edgware.SR3'
}
dependencies {
compile('org.springframework.boot:spring-boot-starter-aop')
compile('org.springframework.boot:spring-boot-starter-security')
compile('org.springframework.boot:spring-boot-starter-web')
compile("org.springframework.boot:spring-boot-devtools")
compile('org.springframework.boot:spring-boot-starter-actuator')
compile group: 'joda-time', name: 'joda-time'
compile group: 'com.myfolder', name: 'all_pfs', version: '7.1.9'
compile group: 'com.myfolder', name: 'pfs-client', version: '7.1.9'
compile group: 'com.myfolder.pfs.wic', name: 'pfs-wic', version: '1.1.0.RC3'
compile group: 'com.picketlink.picketlink', name: 'picketlink-fed', version: '2.0.3-SNAPSHOT'
compile group: 'commons-httpclient', name: 'commons-httpclient', version: '3.1'
compile group: 'commons-lang', name: 'commons-lang', version: '2.6'
compile group: 'org.apache.httpcomponents', name: 'httpclient'
compile group: 'xstream', name: 'xstream', version: '1.2.2'
compile group: 'javax.ejb', name: 'javax.ejb-api', version: '3.2'
compile group: 'io.springfox', name: 'springfox-swagger2', version:'2.6.1'
compile group: 'io.springfox', name: 'springfox-swagger-ui', version:'2.6.1'
compile group: 'org.apache.commons', name: 'commons-io', version: '1.3.2'
compile group: 'commons-beanutils', name: 'commons-beanutils', version: '1.8.3'
compile group: 'org.codehaus.jackson', name: 'jackson-mapper-asl', version: '1.9.13'
compile group: 'org.springframework', name: 'spring-messaging', version: '4.2.6.RELEASE'
compile group: 'org.springframework', name: 'spring-websocket', version: '4.3.11.RELEASE'
compile('org.springframework.boot:spring-boot-starter-test')
compile group: 'org.springframework.boot', name: 'spring-boot-starter-data-jpa', version: '1.5.6.RELEASE'
testCompile group: 'com.microsoft.sqlserver', name: 'sqljdbc4', version: '4.0'
compile name: "sqljdbc4-4.0"
//Added to implement slf4j logger
compile group: 'org.slf4j', name:'slf4j-api', version: '1.7.2'
//compile group: 'ch.qos.logback', name:'logback-classic', version: '1.0.9'
//compile group: 'ch.qos.logback', name:'logback-core', version: '1.0.9'
// jsoup HTML parser library @ https://jsoup.org/
compile 'org.jsoup:jsoup:1.11.3'
compile group: 'com.datastax.cassandra',name: 'cassandra-driver-core',version:'3.2.0'
compile('org.springframework.boot:spring-boot-starter-data-cassandra')
compile('org.projectlombok:lombok:1.18.2')
compile group: 'com.myfolder.service.fusion.audit.client', name: 'audit-client', version: '2.0.1.RELEASE'
compile group: 'org.apache.httpcomponents', name: 'httpasyncclient', version: '4.1.3'
}
dependencyManagement {
imports {
mavenBom "org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}"
}
}
但這一切都從org.springframework.boot / .context / web.client開始不存在:
我刪除了Netbeans CACHE,並讓Netbeans重建項目和指標……仍然,沒有喜悅!
任何幫助或見識將不勝感激。
您已將buildscript
配置為使用Maven Central作為其唯一存儲庫:
repositories {
mavenCentral()
}
您還配置了它以依賴於Spring Boot的Gradle插件的1.4.0.BUILD-SNAPSHOT:
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:1.4.0.BUILD-SNAPSHOT")
}
快照不會發布到Maven Central,而只有發布。 里程碑和快照已發布到https://repo.spring.io 。 具體來說,快照可從https://repo.spring.io/snapshot獲得 ,里程碑可從https://repo.spring.io/milestone獲得 。 你可以找到Boot的搖籃的1.4.0.BUILD-SNAPSHOT插件這里 。
如果要使用Spring Boot的快照版本,則應將https://repo.spring.io/snapshot和https://repo.spring.io/milestone添加到配置的存儲庫中:
repositories {
mavenCentral()
maven { url 'https://repo.spring.io/snapshot' }
maven { url 'https://repo.spring.io/milestone' }
}
需要里程碑存儲庫,因為Spring Boot快照可能具有里程碑依賴性。
另外,特別是考慮到1.4.0現在已經很舊並且不再受支持,您可能需要升級到最新版本。 在撰寫本文時,1.5.17.RELEASE是1.x版本中的最新版本,而2.1.0.RELEASE是2.x版本中的最新版本。
您可以像這樣升級到1.5.17.RELEASE:
buildscript {
ext {
springBootVersion = '1.5.17.RELEASE'
}
repositories {
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:$springBootVersion")
}
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.