我想使用Openshift的S2I构建将其部署到Openshift,其中它是私有云。因此,我试图使用命令 mvn fabric8:deploy将我的Spring应用程序部署到Openshift,但是它出错了,无法构建应用程序。它总是返回Openshift platform has been specified but Openshift has not been detected!,但我在Windows 10上安装了oc客户端,并且工作正常。
我在谷歌上搜索了很长一段时间,但没有得到任何答复。有人能在这个问题上提供帮助吗?
谢谢。
这里是我的pom.xml的一部分
<properties>
<java.version>1.8</java.version>
<fabric8.mode>openshift</fabric8.mode>
<fabric8.namespace>example</fabric8.namespace>
<fabric8.username>acc</fabric8.username>
<fabric8.password>pwd</fabric8.password>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>fabric8-maven-plugin</artifactId>
<version>4.1.0</version>
<executions>
<execution>
<id>fmp</id>
<goals>
<goal>resource</goal>
<goal>helm</goal>
<goal>build</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>实际错误:
[INFO] F8: Running in OpenShift mode
[INFO] F8: Using OpenShift build with strategy S2I
[WARNING] F8: Cannot access cluster for detecting mode: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
[INFO] F8: Running generator spring-boot
[INFO] F8: spring-boot: Using Docker image fabric8/s2i-java:2.3 as base / builder
[WARNING] F8: Cannot access cluster for detecting mode: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
[ERROR] F8: Failed to execute the build [Openshift platform has been specified but Openshift has not been detected!]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 16.639 s
[INFO] Finished at: 2019-07-12T15:36:34+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal io.fabric8:fabric8-maven-plugin:4.1.0:build (fmp) on project greeting: Failed to execute the build: Openshift platform has been specified but Openshift has not been detected! -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionExceptionMaven信息:
Apache Maven 3.6.1 (d66c9c0b3152b2e69ee9bac180bb8fcc8e6af555; 2019-04-05T03:00:29+08:00)
Maven home: C:\somewhere
Java version: 1.8.0_211, vendor: Oracle Corporation, runtime: C:\Program Files\Java\jdk1.8.0_211\jre
Default locale: en_US, platform encoding: MS950
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"
PS C:\Users\somewhere\workspace\greeting>Openshift信息:
oc v3.11.16
kubernetes v1.11.0+d4cacc0
features: Basic-Auth SSPI Kerberos SPNEGO
Server https://openshift-sample-domain.com:8443
openshift v3.11.69
kubernetes v1.11.0+d4cacc0发布于 2020-06-30 11:11:17
我今天遇到了这个问题,决议是:
如果您想要一个如何实现证书导入的具体示例,请告诉我。
https://stackoverflow.com/questions/57002625
复制相似问题