2016-09-28 4 views
2

versagt Ich versuche, meinen springboot App zu laufen ... Es begann alles, als ich die Heureka feder Cloud Plugin meine gradle.build Datei hinzugefügt:Durchführung von gradle bootRun

Kompilierung ‚org.springframework. Wolke: spring-cloud-Starter-Heureka‘

Und wenn ich "gradle bootRun" laufen lasse, erhalte ich diese Fehlermeldung:

verursacht durch: java.io.IOException: nicht Programm ausführen kann„C: \ Programme \ Java \ jdk1.8.0_91 \ bin \ java.exe ". CreateProcess-Fehler = 206, Dateiname zu lang.

Mein build.gradle ist:

import java.text.SimpleDateFormat 

buildscript { 
    ext { 
    springBootVersion = '1.3.2.RELEASE' 
    elasticSearchVersion = '2.2.0' 
    groovyVersion = '2.4.5' 
    } 
    repositories { 
    jcenter() 
    mavenCentral() 
    } 
    dependencies { 
    classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}") 
    classpath 'io.spring.gradle:dependency-management-plugin:0.5.5.RELEASE' 
    classpath 'com.github.ben-manes:gradle-versions-plugin:0.12.0' 
    classpath 'org.kordamp.gradle:stats-gradle-plugin:0.1.5' 
    } 
} 

apply plugin: 'java' 
apply plugin: 'groovy' 
apply plugin: 'eclipse-wtp' 
apply plugin: 'idea' 
apply plugin: 'spring-boot' 
apply plugin: 'io.spring.dependency-management' 
apply plugin: 'com.github.ben-manes.versions' 
apply plugin: 'org.kordamp.gradle.stats' 

def buildDate = new SimpleDateFormat('yyyyMMdd-hhmmss').format(new Date()) 
version = '1.0.RC1.' + buildDate 

sourceCompatibility = 1.8 
targetCompatibility = 1.8 

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

ext['elasticsearch.version'] = elasticSearchVersion 
ext['groovy.version'] = groovyVersion 
ext['guava.version'] = '18.0' 
ext['lombok.version'] = '1.16.6' 

dependencyManagement { 
    imports { 
    mavenBom "org.springframework.boot:spring-boot-starter-parent:${springBootVersion}" 
    mavenBom "org.springframework.cloud:spring-cloud-starter-parent:Brixton.M5" 
    mavenBom 'io.spring.platform:platform-bom:2.0.2.RELEASE' 
    } 
} 

dependencies { 
    compile('org.springframework.boot:spring-boot-starter-actuator') 
    compile('org.springframework.boot:spring-boot-starter-aop') 
    compile('org.springframework.boot:spring-boot-starter-cache') 
    compile('org.springframework.cloud:spring-cloud-starter-hystrix')  
    compile 'org.jadira.usertype:usertype.extended:5.0.0.GA' 
    compile('org.springframework.boot:spring-boot-starter-data-jpa') 
    compile('org.springframework.boot:spring-boot-starter-data-rest') 
    //compile('org.springframework.data:spring-data-rest-hal-browser') 
    compile('org.springframework.boot:spring-boot-devtools') 
    compile('org.springframework.boot:spring-boot-starter-hateoas') 
    compile('org.projectlombok:lombok') 
    compile('org.springframework.boot:spring-boot-starter-thymeleaf') 
    compile('org.springframework.boot:spring-boot-starter-web') 
    compile "org.elasticsearch:elasticsearch:${elasticSearchVersion}" 
    compile 'commons-lang:commons-lang' 
    compile 'commons-codec:commons-codec' 
    compile 'commons-collections:commons-collections' 
    compile 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310' 
    compile 'org.springframework.boot:spring-boot-starter-freemarker' 
    compile 'de.codecentric:spring-boot-admin-starter-client:1.3.2'  
    compile 'org.flywaydb:flyway-core'  
    compile('com.domingosuarez:oneltico:0.1.2') 
    compile("org.springframework:spring-jms") 
    compile("org.apache.activemq:activemq-broker") 
    compile 'org.apache.activemq:activemq-pool'  
    compile 'org.springframework.cloud:spring-cloud-starter-eureka' 
    compile 'com.mashape.unirest:unirest-java:1.4.9'  
    runtime "org.postgresql:postgresql:9.4-1203-jdbc42" 
    testCompile('org.springframework.boot:spring-boot-starter-test') 
} 

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

springBoot { 
    executable = true 
} 

Ich nehme das Plugin aus und führt sie richtig.

Ich weiß, es sollte ein Windows-Problem lange Wege sein, aber wie kann ich eine Lösung geben?

+1

http://tuhrig.de/gradles- bounrun-and-windows-befehlslänge-limit/ –

+0

danke tim_yates! Ich habe in dieser Zeile einfache Anführungszeichen hinzugefügt: it.toURL(). toString(). replaceFirst ('/ file:/+ /', '/') –

Antwort

2

tim_yates war richtig, danke!

Ich greife den Code aus dem Link und fügen Sie es in das Ende meiner build.gradle-Datei, es funktionierte wie ein Juwel!

Der Code i hinzugefügt ist:

task pathingJar(type: Jar) { 
    dependsOn configurations.runtime 
    appendix = 'pathing' 

    doFirst { 
     manifest { 
      attributes "Class-Path": configurations.runtime.files.collect { 
       it.toURL().toString().replaceFirst('/file:/+/', '/') 
       }.join(' ') 
     } 
    } 
} 

bootRun { 
    dependsOn pathingJar 
    doFirst { 
     classpath = files("$buildDir/classes/main", "$buildDir/resources/main", pathingJar.archivePath) 
    } 
} 

Hinweis: i einige einfache Anführungszeichen hinzugefügt (') von dem Linkcode obwohl es funktionierte zu bekommen ..

Verwandte Themen