我有一个简单的Clojure 1.9 project。
它配置了最小.travis.yml
。
language: clojure
lein: 2.8.1
jdk:
- openjdk8
- openjdk9
- oraclejdk8
- oraclejdk9
OpenJDK 8,OracleJDK 8和OracleJDK 9的构建成功。但是,在lein deps
阶段,OpenJDK 9失败了。
无法从Clojars中检索到五个工件。它们是clojure-complete
,clj-http
,pedestal.service
,pedestal.jetty
和pedestal.service-tools
。
似乎是与证书相关的一些问题。我已经在下面列出了一些日志。
Could not find artifact clojure-complete:clojure-complete:jar:0.2.4 in central (https://repo1.maven.org/maven2/)
Could not transfer artifact clojure-complete:clojure-complete:jar:0.2.4 from/to clojars (https://repo.clojars.org/): sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
...
Could not transfer artifact clojure-complete:clojure-complete:pom:0.2.4 from/to clojars (https://repo.clojars.org/): sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
...
This could be due to a typo in :dependencies, file system permissions, or network issues.
If you are behind a proxy, try setting the 'http_proxy' environment variable.
谢谢!
答案 0 :(得分:7)
Travis CI问题跟踪器[1]和clojurians Slack进行了讨论。
原因是OpenJDK 9没有附带签署Clojars'证书。
Christian Stein提到Travis CI将始终提供未修补的JDK安装。如有必要,用户需要对系统CA证书进行符号链接(Original words)。
这是更新后的最小Travis CI配置。
它涉及在before_install
阶段手动对系统CA证书进行符号链接。
language: clojure
lein: 2.8.1
jdk:
- openjdk8
- oraclejdk8
- oraclejdk9
matrix:
include:
- jdk: openjdk9
before_install:
- rm "${JAVA_HOME}/lib/security/cacerts"
- ln -s /etc/ssl/certs/java/cacerts "${JAVA_HOME}/lib/security/cacerts"
或者,您也可以使用自定义矩阵进行JDK安装。
Travis 安装jdk_install.sh
的所有OpenJDK版本都不修补证书。因此,OpenJDK 10和11也会遇到同样的问题。
您可以使用智能放置的YAML锚点减少那些SDK版本的样板文件,如下例所示。
matrix:
include:
- jdk: openjdk9
before_install: &fix_certs
- rm "${JAVA_HOME}/lib/security/cacerts"
- ln -s /etc/ssl/certs/java/cacerts "${JAVA_HOME}/lib/security/cacerts"
- jdk: openjdk10
before_install: *fix_certs
- jdk: openjdk11
before_install: *fix_certs
答案 1 :(得分:0)
道歉,这不是回答您的具体问题,但只是想提一下,看起来您并不是唯一遇到此问题的人:https://github.com/travis-ci/travis-ci/issues/9368#issuecomment-395218865