gradle 編譯 azkaban 出錯


主要出錯信息:

> Could not resolve all artifacts for configuration ':classpath'.
   > Could not resolve com.cinnober.gradle:semver-git:2.2.3.
     Required by:
         project :
      > Could not resolve com.cinnober.gradle:semver-git:2.2.3.
         > Could not get resource 'https://plugins.gradle.org/m2/com/cinnober/gradle/semver-git/2.2.3/semver-git-2.2.3.pom'.
            > Could not GET 'https://plugins.gradle.org/m2/com/cinnober/gradle/semver-git/2.2.3/semver-git-2.2.3.pom'.
               > sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
      > Could not resolve com.cinnober.gradle:semver-git:2.2.3.
         > Could not get resource 'https://repo.maven.apache.org/maven2/com/cinnober/gradle/semver-git/2.2.3/semver-git-2.2.3.pom'.
            > Could not GET 'https://repo.maven.apache.org/maven2/com/cinnober/gradle/semver-git/2.2.3/semver-git-2.2.3.pom'.
               > sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
      > Could not resolve com.cinnober.gradle:semver-git:2.2.3.
         > Could not get resource 'https://plugins.gradle.org/m2/com/cinnober/gradle/semver-git/2.2.3/semver-git-2.2.3.pom'.
            > Could not GET 'https://plugins.gradle.org/m2/com/cinnober/gradle/semver-git/2.2.3/semver-git-2.2.3.pom'.
               > sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
   > Could not resolve org.apache.httpcomponents:httpmime:4.3.
     Required by:
         project : > com.github.kt3k.coveralls:com.github.kt3k.coveralls.gradle.plugin:2.6.3 > org.kt3k.gradle.plugin:coveralls-gradle-plugin:2.6.3
      > Could not resolve org.apache.httpcomponents:httpmime:4.3.
         > Could not get resource 'https://plugins.gradle.org/m2/org/apache/httpcomponents/httpmime/4.3/httpmime-4.3.pom'.
            > Could not GET 'https://plugins.gradle.org/m2/org/apache/httpcomponents/httpmime/4.3/httpmime-4.3.pom'.
               > sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
      > Could not resolve org.apache.httpcomponents:httpmime:4.3.
         > Could not get resource 'https://repo.maven.apache.org/maven2/org/apache/httpcomponents/httpmime/4.3/httpmime-4.3.pom'.
            > Could not GET 'https://repo.maven.apache.org/maven2/org/apache/httpcomponents/httpmime/4.3/httpmime-4.3.pom'.
               > sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
      > Could not resolve org.apache.httpcomponents:httpmime:4.3.
         > Could not get resource 'https://plugins.gradle.org/m2/org/apache/httpcomponents/httpmime/4.3/httpmime-4.3.pom'.
            > Could not GET 'https://plugins.gradle.org/m2/org/apache/httpcomponents/httpmime/4.3/httpmime-4.3.pom'.
               > sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
   > Could not resolve org.eclipse.jgit:org.eclipse.jgit:3.6.0.201412230720-r.
     Required by:
         project : > com.github.kt3k.coveralls:com.github.kt3k.coveralls.gradle.plugin:2.6.3 > org.kt3k.gradle.plugin:coveralls-gradle-plugin:2.6.3
      > Could not resolve org.eclipse.jgit:org.eclipse.jgit:3.6.0.201412230720-r.
         > Could not get resource 'https://plugins.gradle.org/m2/org/eclipse/jgit/org.eclipse.jgit/3.6.0.201412230720-r/org.eclipse.jgit-3.6.0.201412230720-r.pom'.
            > Could not GET 'https://plugins.gradle.org/m2/org/eclipse/jgit/org.eclipse.jgit/3.6.0.201412230720-r/org.eclipse.jgit-3.6.0.201412230720-r.pom'.
               > sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
      > Could not resolve org.eclipse.jgit:org.eclipse.jgit:3.6.0.201412230720-r.
         > Could not get resource 'https://repo.maven.apache.org/maven2/org/eclipse/jgit/org.eclipse.jgit/3.6.0.201412230720-r/org.eclipse.jgit-3.6.0.201412230720-r.pom'.
            > Could not GET 'https://repo.maven.apache.org/maven2/org/eclipse/jgit/org.eclipse.jgit/3.6.0.201412230720-r/org.eclipse.jgit-3.6.0.201412230720-r.pom'.
               > sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
      > Could not resolve org.eclipse.jgit:org.eclipse.jgit:3.6.0.201412230720-r.
         > Could not get resource 'https://plugins.gradle.org/m2/org/eclipse/jgit/org.eclipse.jgit/3.6.0.201412230720-r/org.eclipse.jgit-3.6.0.201412230720-r.pom'.
            > Could not GET 'https://plugins.gradle.org/m2/org/eclipse/jgit/org.eclipse.jgit/3.6.0.201412230720-r/org.eclipse.jgit-3.6.0.201412230720-r.pom'.
               > sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
   > Could not resolve org.codehaus.groovy.modules.http-builder:http-builder:0.7.1.
     Required by:
         project : > com.github.kt3k.coveralls:com.github.kt3k.coveralls.gradle.plugin:2.6.3 > org.kt3k.gradle.plugin:coveralls-gradle-plugin:2.6.3
      > Could not resolve org.codehaus.groovy.modules.http-builder:http-builder:0.7.1.
         > Could not get resource 'https://plugins.gradle.org/m2/org/codehaus/groovy/modules/http-builder/http-builder/0.7.1/http-builder-0.7.1.pom'.
            > Could not GET 'https://plugins.gradle.org/m2/org/codehaus/groovy/modules/http-builder/http-builder/0.7.1/http-builder-0.7.1.pom'.
               > sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
      > Could not resolve org.codehaus.groovy.modules.http-builder:http-builder:0.7.1.
         > Could not get resource 'https://repo.maven.apache.org/maven2/org/codehaus/groovy/modules/http-builder/http-builder/0.7.1/http-builder-0.7.1.pom'.
            > Could not GET 'https://repo.maven.apache.org/maven2/org/codehaus/groovy/modules/http-builder/http-builder/0.7.1/http-builder-0.7.1.pom'.
               > sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
      > Could not resolve org.codehaus.groovy.modules.http-builder:http-builder:0.7.1.
         > Could not get resource 'https://plugins.gradle.org/m2/org/codehaus/groovy/modules/http-builder/http-builder/0.7.1/http-builder-0.7.1.pom'.
            > Could not GET 'https://plugins.gradle.org/m2/org/codehaus/groovy/modules/http-builder/http-builder/0.7.1/http-builder-0.7.1.pom'.
               > sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 15s

解決方法

嘗試了添加網站證書到 JAVA_HOME 依然沒用。

修改 gradlew 文件,在

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script

這一行下加一行:

GRADLE_OPTS=-Dgradle.user.home=/mnt/e/temp

即指定 gradle 臨時目錄,這不是重點,重點是:

把前面出錯信息中下載失敗的各種資源 (pom文件或jar文件)直接通過瀏覽器下載到這個指定的臨時目錄中,然后再執行

./gradlew clean build

如果最終發現還是有幾個 jar 包提示下載出錯,則在上面設置的臨時目錄下找到以下路徑:caches/modules-2/files-2.1,這里就是下載的 jar 包的臨時目錄,按照出錯的 jar 包路徑創建對應的文件夾。如org.eclipse.jgit,具體再參照已經下載成功的一些 jar 包的目錄路徑(因為各個包生成的目錄路徑還不一樣)。把手動下載的 jar 包放進去(不一定產生作用),再執行 上述的build命令,再去看看,有可能就下載成功了。

也有可能此時目錄已經生成,但在最末端的文件夾內只有一個 pom 文件,此時在跟 pom 文件目錄同級的目錄下創建一個文件夾,名稱跟存有 pom 文件的差不多(改掉末尾幾個字符),再把下載好的 jar 文件放進去,然后再執行 build 命令


nodeSetup報錯

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':azkaban-web-server:nodeSetup'.
> Could not resolve all files for configuration ':azkaban-web-server:detachedConfiguration1'.
   > Could not resolve org.nodejs:node:8.10.0.
     Required by:
         project :azkaban-web-server
      > Could not resolve org.nodejs:node:8.10.0.
         > Could not get resource 'https://nodejs.org/dist/v8.10.0/ivy.xml'.
            > Could not GET 'https://nodejs.org/dist/v8.10.0/ivy.xml'.
               > sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 26s
34 actionable tasks: 27 executed, 7 from cache

解決方法

安裝 nodejs,安裝 npm

apt install nodejs
apt install npm

如果還是報這個錯,則進入到 azkaban-web-server 目錄中,修改 build.gradle 文件中的以下內容

即把 download = true 改為 false,讓它使用系統中已經安裝好的 nodejs


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM