gradle wrapper
コマンドを使用してgradlewファイルを作成するときに問題が発生しました。私のセットアップは簡単です:使用のUbuntu 14.04 + Javaの8(OpenJDKのバージョン "1.8.0_91")+ Gradleの3.0Java 8でSpringブートアプリケーションでgradleラッパーが失敗する、Gradle 3:cacertsが見つかりません
チュートリアル:
- https://spring.io/guides/gs/spring-boot/#scratch
- https://docs.gradle.org/current/userguide/gradle_wrapper.html
の好奇心の事この問題は、gradle wrapper
が失敗するのは、cacerts
ファイルまたはディレクトリが見当たりませんからですが、そうではありません(下記の「check cacertsファイル/ディレクトリ」を参照してください)。しかし、これが問題であれば教えてください。実際のファイル/ディレクトリではなくリンクです。私は他の問題があるかどうかわからない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$
ありがとうTobias。私はこのバグについていくつか読んで明日これを試してみます: $ sudo dpkg --purge --force-depends ca-certificates-java に続いて $ sudo apt-get install ca-certificates-java – AHL