2017-10-14 49 views
2

我的项目使用graddlew 4.2.1本地生成。但是当我把它推到GitLab上时,我得到下面的错误。 我必须使用Docker,所以我不知道我可以使用这个工具来运行Docker Image。另外这是gitlab-ci.yml:OpenJDK9(Docker),渐变4.2.1,GitLab

# This file is a template, and might need editing before it works on your project. 
# This template uses the java:8 docker image because there isn't any 
# official Gradle image at this moment 
# 
# This is the Gradle build system for JVM applications 
# https://gradle.org/ 
# https://github.com/gradle/gradle 
image: openjdk:9-jdk 

# Disable the Gradle daemon for Continuous Integration servers as correctness 
# is usually a priority over speed in CI environments. Using a fresh 
# runtime for each build is more reliable since the runtime is completely 
# isolated from any previous builds. 
variables: 
    GRADLE_OPTS: "-Dorg.gradle.daemon=false" 

# Make the gradle wrapper executable. This essentially downloads a copy of 
# Gradle to build the project with. 
# https://docs.gradle.org/current/userguide/gradle_wrapper.html 
# It is expected that any modern gradle project has a wrapper 
before_script: 
    - chmod +x gradlew 

# We redirect the gradle user home using -g so that it caches the 
# wrapper and dependencies. 
# https://docs.gradle.org/current/userguide/gradle_command_line.html 
# 
# Unfortunately it also caches the build output so 
# cleaning removes reminants of any cached builds. 
# The assemble task actually builds the project. 
# If it fails here, the tests can't run. 
build: 
    stage: build 
    script: 
    - ./gradlew -g /cache/.gradle clean assemble 
    allow_failure: false 
    artifacts: 
    name: "AudioBot" 
    paths: 
     - build/libs/*.jar 

在这里的错误:

Exception in thread "main" javax.net.ssl.SSLException: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty at java.base/sun.security.ssl.Alerts.getSSLException(Alerts.java:214) at java.base/sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1969) at java.base/sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1921) at java.base/sun.security.ssl.SSLSocketImpl.handleException(SSLSocketImpl.java:1904) at java.base/sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1436) at java.base/sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1413) at java.base/sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:567) at java.base/sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:185) at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1563) at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1491) at java.base/sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:236) at org.gradle.wrapper.Download.downloadInternal(Download.java:66) at org.gradle.wrapper.Download.download(Download.java:51) at org.gradle.wrapper.Install$1.call(Install.java:62) at org.gradle.wrapper.Install$1.call(Install.java:48) at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:69) at org.gradle.wrapper.Install.createDist(Install.java:48) at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:107) at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61) Caused by: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty at java.base/sun.security.validator.PKIXValidator.(PKIXValidator.java:89) at java.base/sun.security.validator.Validator.getInstance(Validator.java:181) at java.base/sun.security.ssl.X509TrustManagerImpl.getValidator(X509TrustManagerImpl.java:330) at java.base/sun.security.ssl.X509TrustManagerImpl.checkTrustedInit(X509TrustManagerImpl.java:180) at java.base/sun.security.ssl.X509TrustManagerImpl.checkTrusted(X509TrustManagerImpl.java:192) at java.base/sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:133) at java.base/sun.security.ssl.ClientHandshaker.checkServerCerts(ClientHandshaker.java:1825) at java.base/sun.security.ssl.ClientHandshaker.certificateStatus(ClientHandshaker.java:1676) at java.base/sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:272) at java.base/sun.security.ssl.Handshaker.processLoop(Handshaker.java:1086) at java.base/sun.security.ssl.Handshaker.processRecord(Handshaker.java:1020) at java.base/sun.security.ssl.SSLSocketImpl.processInputRecord(SSLSocketImpl.java:1137) at java.base/sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1074) at java.base/sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:973) at java.base/sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1402) at java.base/sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1429) ... 14 more Caused by: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty at java.base/java.security.cert.PKIXParameters.setTrustAnchors(PKIXParameters.java:200) at java.base/java.security.cert.PKIXParameters.(PKIXParameters.java:120) at java.base/java.security.cert.PKIXBuilderParameters.(PKIXBuilderParameters.java:104) at java.base/sun.security.validator.PKIXValidator.(PKIXValidator.java:86) ... 29 more ERROR: Job failed: exit code 1

这将是很好,如果有人可以帮助我。谢谢! :)

+0

[Error - trustAnchors参数必须为非空]的可能重复(https://stackoverflow.com/questions/6784463/error-trustanchors-parameter-must-be-non-empty) – nullpointer

+0

好的,好吧,但是我正在使用Docker。没有任何可以提供graddlew和java9所需证书的Docker镜像吗? –

+0

构建工具称为** gradle **,而不是** graddle ** – Henry

回答

1

要进行测试,您可以在docker-library/openjdk之一上进行测试。

docker-library/openjdk issue 19
ca-certificates-java.postinst configure应该是有自PR 111,但如果在“Error - trustAnchors parameter must be non-empty”提到的另一种方法,你可以在你的自定义图像对它进行测试。

请注意,moby/moby issue 18180曾经受到影响ca-certificates-java.postinst configure,但现在应该好了。

+0

尝试添加命令来更新证书,但没有帮助:http://paste.ubuntu.com/25737403/仍然相同。任何其他想法? :) –

+0

这有一个错误报告:https://github.com/docker-library/openjdk/issues/145谢谢你的帮助! :) –