2016-09-12 1 views
0

gradle wrapper 명령을 사용하여 gradlew 파일을 만들 때 문제가 발생했습니다. 내 설정은 간단하다 : 우분투 14.04 + 자바 8 (오픈 JDK 버전 "1.8.0_91") + Gradle을 3.0Java 8의 Spring Boot 응용 프로그램에서 gradle wrapper가 실패합니다. Gradle 3 : cacerts를 찾을 수 없습니다.

자습서를 사용 :

의 호기심 일 이 문제는 gradle wrapper이 실패하는 이유는 파일 또는 디렉토리가 분명히 누락 되었기 때문입니다.하지만 그렇지 않습니다 (아래 'check cacerts file/directory'참조). 비록 이것이 문제가된다면 알려 주시기 바랍니다. 링크이며 실제 파일/디렉토리는 아닙니다. 누락 된 cacerts 오류가 캐스케이드 오류의 끝 부분에있는 것 같으면 다른 문제가 있는지 모르겠지만이를 디버그하는 데 도움이 될 것입니다.

관련 파일과 출력물은 다음과 같습니다.

건배

AHL


build.gradle :

buildscript { 
    repositories { 
     mavenCentral() 
    } 
    dependencies { 
     classpath("org.springframework.boot:spring-boot-gradle-plugin:1.4.0.RELEASE") 
    } 
} 

apply plugin: 'java' 
apply plugin: 'eclipse' 
apply plugin: 'idea' 
apply plugin: 'spring-boot' 

jar { 
    baseName = 'gs-spring-boot' 
    version = '0.1.0' 
} 

repositories { 
    mavenCentral() 
} 

sourceCompatibility = 1.8 
targetCompatibility = 1.8 

dependencies { 
    // tag::jetty[] 
    compile("org.springframework.boot:spring-boot-starter-web") { 
     exclude module: "spring-boot-starter-tomcat" 
    } 
    compile("org.springframework.boot:spring-boot-starter-jetty") 
    // end::jetty[] 
    // tag::actuator[] 
    compile("org.springframework.boot:spring-boot-starter-actuator") 
    // end::actuator[] 
    testCompile("junit:junit") 
} 

문제/오류 :

org.apache.http.ssl.SSLInitializationException: /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/security/cacerts (No such file or directory) 

체크 cacerts 파일/디렉토리 :

Gradle을 래퍼를 실행 한
[email protected]:/vagrant/BootTutorial$ ll /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/security/cacerts 
lrwxrwxrwx 1 root root 27 Apr 22 13:29 /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/security/cacerts -> /etc/ssl/certs/java/cacerts 
[email protected]:/vagrant/BootTutorial$ 

출력 :

[email protected]:/vagrant/BootTutorial$ gradle wrapper --gradle-version 3.0 --info 
Initialized native services in: /home/vagrant/.gradle/native 
Connected to daemon DaemonInfo{pid=21004, address=[61084cbc-02a2-47e1-9f7b-07d285c509b7 port:43425, addresses:[/0:0:0:0:0:0:0:1%lo, /127.0.0.1]], idle=true, lastBusy=1473685805551, context=DefaultDaemonContext[uid=b5dcb202-0edb-4f81-bd5b-bd4b828045a5,javaHome=/usr/lib/jvm/java-8-openjdk-amd64,daemonRegistryDir=/home/vagrant/.gradle/daemon,pid=21004,idleTimeout=10800000,daemonOpts=-XX:MaxPermSize=256m,-XX:+HeapDumpOnOutOfMemoryError,-Xmx1024m,-Dfile.encoding=UTF-8,-Duser.country=US,-Duser.language=en,-Duser.variant]}. Dispatching request Build{id=ac0e688f-bffe-4828-abe8-58f12354dcf6.1, currentDir=/vagrant/BootTutorial}. 
Received result [email protected] from daemon DaemonInfo{pid=21004, address=[61084cbc-02a2-47e1-9f7b-07d285c509b7 port:43425, addresses:[/0:0:0:0:0:0:0:1%lo, /127.0.0.1]], idle=true, lastBusy=1473685805551, context=DefaultDaemonContext[uid=b5dcb202-0edb-4f81-bd5b-bd4b828045a5,javaHome=/usr/lib/jvm/java-8-openjdk-amd64,daemonRegistryDir=/home/vagrant/.gradle/daemon,pid=21004,idleTimeout=10800000,daemonOpts=-XX:MaxPermSize=256m,-XX:+HeapDumpOnOutOfMemoryError,-Xmx1024m,-Dfile.encoding=UTF-8,-Duser.country=US,-Duser.language=en,-Duser.variant]} (build should be starting). 
The client will now receive all logging from the daemon (pid: 21004). The daemon log file: /home/vagrant/.gradle/daemon/3.0/daemon-21004.out.log 
Starting 7th build in daemon [uptime: 39 mins 8.147 secs, performance: 91%] 
Executing build with daemon context: DefaultDaemonContext[uid=b5dcb202-0edb-4f81-bd5b-bd4b828045a5,javaHome=/usr/lib/jvm/java-8-openjdk-amd64,daemonRegistryDir=/home/vagrant/.gradle/daemon,pid=21004,idleTimeout=10800000,daemonOpts=-XX:MaxPermSize=256m,-XX:+HeapDumpOnOutOfMemoryError,-Xmx1024m,-Dfile.encoding=UTF-8,-Duser.country=US,-Duser.language=en,-Duser.variant] 
Starting Build 
Settings evaluated using settings file '/master/settings.gradle'. 
Projects loaded. Root project using build file '/vagrant/BootTutorial/build.gradle'. 
Included projects: [root project 'BootTutorial'] 
Evaluating root project 'BootTutorial' using build file '/vagrant/BootTutorial/build.gradle'. 

FAILURE: Build failed with an exception. 

* What went wrong: 
A problem occurred configuring root project 'BootTutorial'. 
> Could not resolve all dependencies for configuration ':classpath'. 
    > Could not resolve org.springframework.boot:spring-boot-gradle-plugin:1.4.0.RELEASE. 
    Required by: 
     :BootTutorial:unspecified 
     > Could not resolve org.springframework.boot:spring-boot-gradle-plugin:1.4.0.RELEASE. 
     > Could not get resource 'https://repo1.maven.org/maven2/org/springframework/boot/spring-boot-gradle-plugin/1.4.0.RELEASE/spring-boot-gradle-plugin-1.4.0.RELEASE.pom'. 
      > org.apache.http.ssl.SSLInitializationException: /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/security/cacerts (No such file or directory) 

* Try: 
Run with --stacktrace option to get the stack trace. Run with --debug option to get more log output. 

BUILD FAILED 

Total time: 1.391 secs 
Received result Failure[value=org.gradle.initialization.ReportedException: org.gradle.internal.exceptions.LocationAwareException: A problem occurred configuring root project 'BootTutorial'.] from daemon DaemonInfo{pid=21004, address=[61084cbc-02a2-47e1-9f7b-07d285c509b7 port:43425, addresses:[/0:0:0:0:0:0:0:1%lo, /127.0.0.1]], idle=true, lastBusy=1473685805551, context=DefaultDaemonContext[uid=b5dcb202-0edb-4f81-bd5b-bd4b828045a5,javaHome=/usr/lib/jvm/java-8-openjdk-amd64,daemonRegistryDir=/home/vagrant/.gradle/daemon,pid=21004,idleTimeout=10800000,daemonOpts=-XX:MaxPermSize=256m,-XX:+HeapDumpOnOutOfMemoryError,-Xmx1024m,-Dfile.encoding=UTF-8,-Duser.country=US,-Duser.language=en,-Duser.variant]} (build should be done). 
[email protected]:/vagrant/BootTutorial$ 

답변

1

당신은 아마 herehere을보고 댕글 링 인증서 표시에 심볼릭 링크를 왼쪽 버그를 치고있다. 해결 방법 중 하나는 ca-certificates-java 패키지를 다시 설치하는 것입니다. 이렇게 :

$ sudo dpkg --purge --force-depends ca-certificates-java 
$ sudo apt-get install ca-certificates-java 
+0

감사합니다. Tobias. 나는이 버그에 대한 책을 읽고 내일 이것을 시도 할 것이다 : $ sudo dpkg --purge --force-depends ca-certificates-java 다음에 $ sudo apt-get install ca-certificates-java – AHL

관련 문제