我一直在拼命嘗試使用 ROS2 和 PX4,但我無法編譯所有必要的包:Fast-RTPS-Gen
想知道PX4的人:
- 如 PX4 網站上所述,我正在使用隨 sdk 安裝的 Gradle 6.3 版。
- 我已經從 Fast-RTPS-Gen 存盤庫下載了 1.0.4 版本
當我嘗試用 Gradle 編譯它時,我有一個證書(見問題的結尾)。
我的問題是:我怎樣才能繞過這個?由于我不打算在 Java 上開發任何東西,我只需要編譯這個東西,我對繞過這個證書檢查的最快、最骯臟的方法非常感興趣。我嘗試使用 keytool 從 Maven 存盤庫添加證書,但我無法讓它作業。
> Task :buildIDLParser FAILED
FAILURE: Build failed with an exception.
* Where:
Build file '/home/evandro/Fast-RTPS-Gen/thirdparty/idl-parser/idl.gradle' line: 89
* What went wrong:
Could not determine the dependencies of task ':idl-parser:jar'.
> Could not resolve all files for configuration ':idl-parser:compile'.
> Could not resolve org.antlr:antlr4:4.5.
Required by:
project :idl-parser
> Could not resolve org.antlr:antlr4:4.5.
> Could not get resource 'https://repo.maven.apache.org/maven2/org/antlr/antlr4/4.5/antlr4-4.5.pom'.
> Could not GET 'https://repo.maven.apache.org/maven2/org/antlr/antlr4/4.5/antlr4-4.5.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.antlr:antlr4:4.5.
Required by:
project :idl-parser
> Could not resolve org.antlr:antlr4:4.5.
> Could not get resource 'https://repo.maven.apache.org/maven2/org/antlr/antlr4/4.5/antlr4-4.5.pom'.
> Could not GET 'https://repo.maven.apache.org/maven2/org/antlr/antlr4/4.5/antlr4-4.5.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.antlr:stringtemplate:3.2.
Required by:
project :idl-parser
> Could not resolve org.antlr:stringtemplate:3.2.
> Could not get resource 'https://repo.maven.apache.org/maven2/org/antlr/stringtemplate/3.2/stringtemplate-3.2.pom'.
> Could not GET 'https://repo.maven.apache.org/maven2/org/antlr/stringtemplate/3.2/stringtemplate-3.2.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
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.4/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 653ms
4 actionable tasks: 2 executed, 2 up-to-date
uj5u.com熱心網友回復:
據我所知,無法通過配置禁用 JVM 證書驗證。由于您遇到證書驗證失敗https://repo.maven.apache.org,這在大多數系統上都不應該發生,我猜您是在公司防火墻后面。
如果您在 Windows 上,請嘗試將環境變數設定JAVA_TOOL_OPTIONS為(完全):
-Djavax.net.ssl.trustStoreType=Windows-ROOT -Djavax.net.ssl.trustStore=NUL
如果您使用的是 Mac,請嘗試將其設定為:
-Djavax.net.ssl.trustStoreType=KeychainStore -Djavax.net.ssl.trustStore=/dev/null
如果這些都不起作用,您可以復制 JVM 的現有密鑰庫,并使用 將您的公司證書添加到其中keytool,這很容易通過 Google 查找。在這種情況下,您將在 env var 中使用這些設定:
-Djavax.net.ssl.trustStore=/my/trust_store -Djavax.net.ssl.trustStorePassword=my_password
uj5u.com熱心網友回復:
設法通過使用 sudo 編譯來解決它:
sudo env "PATH=$PATH" gradle assemble
因為我對 gradle 一無所知,所以花了我一整天的時間,結果它只是一個愚蠢的簡單解決方案。我建議將此作為注釋添加到 PX4 安裝指南中。
轉載請註明出處,本文鏈接:https://www.uj5u.com/qukuanlian/408796.html
標籤:
上一篇:如何在SpringBoot中獲取不包括空格的命令列引數?
下一篇:processDebugMainManifestFAILED,我在使用targetSdkVersion作為31時遇到此錯誤
