title: How to fix 'Openshift has not been detected' on fabric8 via maven during deployment
body: <p>I would like to use Openshift's S2I-build to deploy to Openshift where it is a private cloud.
  So, I am trying to deploy my <strong>Spring Boot app</strong> to Openshift with the command 
  <code>mvn fabric8:deploy</code> but it got error and failed to build the application. It always returned <code>Openshift platform has been specified but Openshift has not been detected!</code> but I got <code>oc</code> client installed on Windows 10 and it works properly.</p>
  
  <p>I searched it on Google for a long time but got no answer. Could anyone help on this issue?</p>
  
  <p>Thanks.</p>
  
  <p>Here is part of my pom.xml</p>
  
  <pre><code>&lt;properties&gt;
      &lt;java.version&gt;1.8&lt;/java.version&gt;
      &lt;fabric8.mode&gt;openshift&lt;/fabric8.mode&gt;
      &lt;fabric8.namespace&gt;example&lt;/fabric8.namespace&gt;
      &lt;fabric8.username&gt;acc&lt;/fabric8.username&gt;
      &lt;fabric8.password&gt;pwd&lt;/fabric8.password&gt;
  &lt;/properties&gt;
  &lt;build&gt;
      &lt;plugins&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-maven-plugin&lt;/artifactId&gt;
          &lt;/plugin&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;io.fabric8&lt;/groupId&gt;
              &lt;artifactId&gt;fabric8-maven-plugin&lt;/artifactId&gt;
              &lt;version&gt;4.1.0&lt;/version&gt;
              &lt;executions&gt;
                  &lt;execution&gt;
                      &lt;id&gt;fmp&lt;/id&gt;
                      &lt;goals&gt;
                          &lt;goal&gt;resource&lt;/goal&gt;
                          &lt;goal&gt;helm&lt;/goal&gt;
                          &lt;goal&gt;build&lt;/goal&gt;
                      &lt;/goals&gt;
                  &lt;/execution&gt;
              &lt;/executions&gt;
          &lt;/plugin&gt;
      &lt;/plugins&gt;
  &lt;/build&gt;
  
  </code></pre>
  
  <p>The actual error:</p>
  
  <pre><code>[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! -&gt; [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
  </code></pre>
  
  <p>Maven info:</p>
  
  <pre><code>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&gt;
  </code></pre>
  
  <p>Openshift info:</p>
  
  <pre><code>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
  </code></pre>