docker - Gradle 在容器内部不起作用,但在外部起作用
问题描述
出于某种原因,在 docker 容器中,gradle 不适用于我。当然,在容器之外它工作正常。奇怪的是它并没有说明缺少什么文件或目录。
# ./gradlew clean -s
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'foo-bar'.
> Could not resolve com.google.protobuf:protobuf-gradle-plugin:0.8.9.
> Could not get resource 'https://jcenter.bintray.com/com/google/protobuf/protobuf-gradle-plugin/0.8.9/protobuf-gradle-plugin-0.8.9.pom'.
> org.apache.http.ssl.SSLInitializationException: (No such file or directory)
Caused by: java.io.FileNotFoundException: (No such file or directory)
at java.base/java.io.FileInputStream.open0(Native Method)
at java.base/java.io.FileInputStream.open(FileInputStream.java:219)
at java.base/java.io.FileInputStream.<init>(FileInputStream.java:157)
at org.gradle.internal.resource.transport.http.DefaultSslContextFactory$SslContextCacheLoader.initTrustManagerFactory(DefaultSslContextFactory.java:146)
at org.gradle.internal.resource.transport.http.DefaultSslContextFactory$SslContextCacheLoader.load(DefaultSslContextFactory.java:119)
... 248 more
解决方案
似乎问题在于javax.net.ssl.trustStore被设置为空白并覆盖默认值,这也解释了为什么 FileNotFoundException 似乎没有指定值。
推荐阅读
- php - 我需要 PHP 和 SQL 中的帐户对帐单表
- python - Pyqt5:尝试添加QLayout“表单”,已经有布局(多继承python)
- r - 在函数内调用 lm() 中的权重无法正确评估
- linux - IF 语句更改变量的值
- c# - 制作一个通用的 js 文件以在所有视图中使用
- android - 我正在使用android studio 3.1.3,每当我添加导航抽屉活动并且某些xml文件无法正常工作时,它都会给我错误
- r - 在 Bookdown 中提供自定义模板时未呈现标题和作者
- docker - 即使在系统生成后,docker 仍然从缓存中构建
- javascript - 在 React 中将一个盒子添加到盒子列表中的动画
- apache-spark - pyspark 中的列