2017-02-24 5 views
0

**enter image description here**のGradle Eclipseのクラスパス例外:FAILURE:私はGradleの日食を実行しようとしていたときに、上記の画像に添付として、私はエラーを取得しています例外

で失敗しましたビルドします。 私はこのeclipseClassPath例外を取得し続けます。

私は使用しています3.1 誰かがgradleバージョン2.14を使用するように勧めました。なぜなら、最新バージョンのgradleでは動作しないからです。

私のbuild.gradleファイルは以下の通りです:

buildscript { 
    ext { 
     springBootVersion = '1.2.3.RELEASE' 
     springCloudConnectorsVersion = '1.2.3.RELEASE' 
     jarName = 'comOrderAudit' 
     jarVersion = ' -jar build/libs/app-0.0.1-SNAPSHOT.jar' 
    } 

    repositories { 
     mavenCentral() 
     mavenLocal() 
     jcenter() 
    } 

    dependencies { 
     classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}") 
     classpath("io.spring.gradle:dependency-management-plugin:0.5.0.RELEASE") 
    } 
} 

repositories { 
    mavenCentral() 
    mavenLocal() 
    jcenter() 
} 

apply plugin: 'spring-boot' 
apply plugin: 'java' 
apply plugin: 'application' 
apply plugin: 'eclipse' 
apply plugin: 'war' 
apply plugin: 'jacoco' 

dependencies { 
    compile("org.springframework.boot:spring-boot-starter-actuator") { 
     exclude module: "spring-boot-starter-logging" 
     exclude module: "logback-classic" 
    } 
    compile "org.springframework.boot:spring-boot-starter-test" 
    compile("org.springframework.boot:spring-boot-starter-web") { 
     exclude module: "spring-boot-starter-logging" 
     exclude module: "logback-classic" 
    } 
    compile("org.springframework.boot:spring-boot-starter-aop") { 
     exclude module: "spring-boot-starter-logging" 
     exclude module: "logback-classic" 
    } 

    "org.springframework.cloud:Spring-cloud-core:${springCloudConnectorsVersion}" 
    compile "org.springframework.cloud:spring-cloud-spring-service-connector:${springCloudConnectorsVersion}" 
    compile "org.springframework.cloud:spring-cloud-cloudfoundry-connector:${springCloudConnectorsVersion}" 
    compile 'org.codehaus.jettison:jettison:1.3.8' 

    compile 'com.datastax.cassandra:cassandra-driver-core:2.1.8' 
    compile 'com.google.code.gson:gson:2.3.1' 

    compile 'org.springframework.boot:spring-boot-starter-log4j2' 
    compile 'org.springframework:spring-oxm' 
    compile 'org.simpleframework:simple-xml:2.7.1' 
    compile 'io.springfox:springfox-swagger2:2.0.0' 
    compile 'io.springfox:springfox-swagger-ui:2.0.0' 
    compile 'com.wordnik:swagger-jersey2-jaxrs_2.10:1.3.8' 
    compile 'com.mangofactory:swagger-springmvc:1.0.2' 
    compile 'com.datastax.cassandra:cassandra-driver-core:2.1.8'  
    compile 'com.google.code.gson:gson:2.3.1' 
    testCompile "junit:junit:4.12" 
    testCompile "org.springframework.boot:spring-boot-starter-test" 
    testCompile 'commons-dbcp:commons-dbcp:1.4' 

} 

task updateVersion{ 
    Properties props = new Properties() 
    File propsFile = new File("src/main/resources/application.properties") 
    props.load(propsFile.newDataInputStream()) 
    println(props.getProperty("buildNumber")+"v") 
    Integer nextbuildnum = (((props.getProperty("buildNumber")) as Integer) + 1) 
    props.setProperty('buildNumber', nextbuildnum.toString()) 
    def date = new Date() 
    def formattedDate = date.format('yyyyMMddHHmmss') 
    props.setProperty("buildTimeStamp", formattedDate) 
    props.store(propsFile.newWriter(), null) 
    props.load(propsFile.newDataInputStream()) 
} 

test { 
    testLogging { 
     events 'started', 'passed' 
    } 
    jacocoTestReport{ 
     group = "Reporting" 
     description = "Generate Jacoco coverage reports." 
     additionalSourceDirs = files(sourceSets.main.java) 
     reports { 
      xml.enabled = false 
      html.enabled = true 
     } 

     afterEvaluate { 
      classDirectories = files(classDirectories.files.collect { 
       fileTree(dir: it, 
         exclude: ['**/model/**']) 
      }) 
     } 
    } 
} 

答えて

0

私は大規模な検索で答えを見つけました。

この問題は、gradleで使用されているSpringブートバージョンのようでした。 Gradleバージョン3.1では、推奨されるスプリングブートバージョンは1.4.xリリースです。 スプリングブートバージョン1.2.3を使用する場合、私が使用するはずのgradleバージョンは2.14です。 ちょうど春のブートバージョンを変更し、ビルドが成功しました。

このページで詳しく見ることができますhere.

関連する問題