尝试使用 gradle bootrun 编译并获取无法找到 spring-boot-gradle-plugin:1.4.0.BUILD-SNAPSHOT [英] Trying to compile with gradle bootrun and get cannot find spring-boot-gradle-plugin:1.4.0.BUILD-SNAPSHOT

查看:59
本文介绍了尝试使用 gradle bootrun 编译并获取无法找到 spring-boot-gradle-plugin:1.4.0.BUILD-SNAPSHOT的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在 cmd 提示窗口中使用gradle bootrun"运行我的 gradle 项目.

我得到的错误是这样的:

  • 出了什么问题:配置根项目kyp4-backend"时出现问题.<块引用>

    无法解析配置:classpath"的所有工件.找不到 org.springframework.boot:spring-boot-gradle-plugin:1.4.0.BUILD-SNAPSHOT.在以下位置搜索:

    • 我删除了 Netbeans CACHE 并让 Netbeans 重建项目和索引......仍然没有快乐!

      任何帮助或见解将不胜感激.

      解决方案

      您已将 buildscript 配置为使用 Maven Central 作为其唯一存储库:

      存储库 {MavenCentral()}

      您也已将其配置为依赖于 Spring Boot 的 Gradle 插件的 1.4.0.BUILD-SNAPSHOT:

      依赖项{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 的 Gradle 插件的 1.4.0.BUILD-SNAPSHOT 此处.

      如果你想使用 Spring Boot 的快照版本,你应该添加 https://repo.spring.io/snapshothttps://repo.spring.io/milestone 到配置好的存储库:

      存储库 {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 {分机{springBootVersion = '1.5.17.RELEASE'}存储库{MavenCentral()}依赖{classpath("org.springframework.boot:spring-boot-gradle-plugin:$springBootVersion")}}

      I'm running my gradle project with "gradle bootrun" on a cmd prompt window.

      The error I get is this:

      ************ GRADLE *****************

      So here's my build.gradle file:

      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}"
          }
      }
      

      But this is all starting with org.springframework.boot/.context/web.client does not exist:

      Here's a couple images to show:

      I deleted the Netbeans CACHE and let Netbeans rebuild projects and indicies... still, no joy!

      Any help or insight would be greatly appreciated.

      解决方案

      You have configured your buildscript to use Maven Central as its only repository:

      repositories {
          mavenCentral()
      }
      

      You have also configured it to depend on 1.4.0.BUILD-SNAPSHOT of Spring Boot's Gradle Plugin:

      dependencies {
          classpath("org.springframework.boot:spring-boot-gradle-plugin:1.4.0.BUILD-SNAPSHOT")
      }
      

      Snapshots are not published to Maven Central, only releases are published there. Milestones and snapshots are published to https://repo.spring.io. Specifically, snapshots are available from https://repo.spring.io/snapshot and milestones are available from https://repo.spring.io/milestone. You can find 1.4.0.BUILD-SNAPSHOT of Boot's Gradle plugin here.

      If you want to use a snapshot version of Spring Boot, you should add https://repo.spring.io/snapshot and https://repo.spring.io/milestone to the configured repositories:

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

      The milestone repository is required as a Spring Boot snapshot may have milestone dependencies.

      Alternatively, and particularly given that 1.4.0 is rather old now and no longer supported, you may want to upgrade to a more recent release. At the time of writing, 1.5.17.RELEASE is the latest in the 1.x line and 2.1.0.RELEASE is the latest in the 2.x line.

      You could upgrade to 1.5.17.RELEASE like this:

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

      这篇关于尝试使用 gradle bootrun 编译并获取无法找到 spring-boot-gradle-plugin:1.4.0.BUILD-SNAPSHOT的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆