首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在部署期间通过maven修复fabric8上的“Openshift未被检测到”

如何在部署期间通过maven修复fabric8上的“Openshift未被检测到”
EN

Stack Overflow用户
提问于 2019-07-12 07:59:20
回答 1查看 1K关注 0票数 0

我想使用Openshift的S2I构建将其部署到Openshift,其中它是私有云。因此,我试图使用命令 mvn fabric8:deploy将我的Spring应用程序部署到Openshift,但是它出错了,无法构建应用程序。它总是返回Openshift platform has been specified but Openshift has not been detected!,但我在Windows 10上安装了oc客户端,并且工作正常。

我在谷歌上搜索了很长一段时间,但没有得到任何答复。有人能在这个问题上提供帮助吗?

谢谢。

这里是我的pom.xml的一部分

代码语言:javascript
复制
<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>

实际错误:

代码语言:javascript
复制
[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/MojoExecutionException

Maven信息:

代码语言:javascript
复制
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信息:

代码语言:javascript
复制
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
EN

回答 1

Stack Overflow用户

发布于 2020-06-30 11:11:17

我今天遇到了这个问题,决议是:

  • 在尝试构建/部署之前,请确保已登录到openshift集群。
  • 确保将集群的公共证书导入到JRE仙人掌信任库中。

如果您想要一个如何实现证书导入的具体示例,请告诉我。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/57002625

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档