title: Unable to Deploy Spring Boot Application In Openshift
body: <p>I am following the below steps to run my Spring Boot app: <a href="https://github.com/debasen/springboot-demo.git" rel="nofollow noreferrer">https://github.com/debasen/springboot-demo.git</a> in <a href="https://www.openshift.com/" rel="nofollow noreferrer">Open shift</a>:</p>
  
  <ol>
  <li>Add Red Hat OpenJDK8 to my project.</li>
  </ol>
  
  <p><a href="https://i.stack.imgur.com/SCeIk.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/SCeIk.png" alt="enter image description here"></a>
  2. Next
  <a href="https://i.stack.imgur.com/DTA6N.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/DTA6N.png" alt="enter image description here"></a>
  3. Add hit repository
  <a href="https://i.stack.imgur.com/77yfi.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/77yfi.png" alt="enter image description here"></a></p>
  
  <p>After doing this. I am getting the following Log at Build:</p>
  
  <pre><code>Cloning "https://github.com/debasen/springboot-demo.git " ...
      Commit: c3b500b7c27540de6f1ef90734aca8b1a09d6fb6 (Initial Commit)
      Author: Admin &lt;Admin@DESKTOP-78DNBRA&gt;
      Date:   Sun Mar 18 20:48:29 2018 +0530
  Pulling image "registry.access.redhat.com/redhat-openjdk-18/openjdk18-openshift@sha256:afe904fd986c4147d1905813eb1a2f5bc3480ecad5b70b4ccfec384271777429" ...
  ==================================================================
  Starting S2I Java Build .....
  S2I source build with plain binaries detected
  Copying binaries from /tmp/src to /deployments ...
  ... done
  
  Pushing image docker-registry.default.svc:5000/boot-test1/spring-demo:latest ...
  Push successful
  </code></pre>
  
  <p>And Deployment fails with the following log:</p>
  
  <pre><code>Starting the Java application using /opt/run-java/run-java.sh ...
  ERROR: Neither $JAVA_MAIN_CLASS nor $JAVA_APP_JAR is set and 0 JARs found in /deployments (1 expected)
  exec java -javaagent:/opt/jolokia/jolokia.jar=config=/opt/jolokia/etc/jolokia.properties -Xms256m -Xmx256m -XX:+UseParallelGC -XX:MinHeapFreeRatio=20 -XX:MaxHeapFreeRatio=40 -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -XX:MaxMetaspaceSize=100m -XX:ParallelGCThreads=1 -Djava.util.concurrent.ForkJoinPool.common.parallelism=1 -XX:CICompilerCount=2 -XX:+ExitOnOutOfMemoryError -cp . -jar
  Error: -jar requires jar file specification
  Usage: java [-options] class [args...]
             (to execute a class)
     or  java [-options] -jar jarfile [args...]
             (to execute a jar file)
  where options include:
      -d32      use a 32-bit data model if available
      -d64      use a 64-bit data model if available
      -server   to select the "server" VM
                    The default VM is server,
                    because you are running on a server-class machine.
  
  
      -cp &lt;class search path of directories and zip/jar files&gt;
      -classpath &lt;class search path of directories and zip/jar files&gt;
                    A : separated list of directories, JAR archives,
                    and ZIP archives to search for class files.
      -D&lt;name&gt;=&lt;value&gt;
                    set a system property
      -verbose:[class|gc|jni]
                    enable verbose output
      -version      print product version and exit
      -version:&lt;value&gt;
                    Warning: this feature is deprecated and will be removed
                    in a future release.
                    require the specified version to run
      -showversion  print product version and continue
      -jre-restrict-search | -no-jre-restrict-search
                    Warning: this feature is deprecated and will be removed
                    in a future release.
                    include/exclude user private JREs in the version search
      -? -help      print this help message
      -X            print help on non-standard options
      -ea[:&lt;packagename&gt;...|:&lt;classname&gt;]
      -enableassertions[:&lt;packagename&gt;...|:&lt;classname&gt;]
                    enable assertions with specified granularity
      -da[:&lt;packagename&gt;...|:&lt;classname&gt;]
      -disableassertions[:&lt;packagename&gt;...|:&lt;classname&gt;]
                    disable assertions with specified granularity
      -esa | -enablesystemassertions
                    enable system assertions
      -dsa | -disablesystemassertions
                    disable system assertions
      -agentlib:&lt;libname&gt;[=&lt;options&gt;]
                    load native agent library &lt;libname&gt;, e.g. -agentlib:hprof
                    see also, -agentlib:jdwp=help and -agentlib:hprof=help
      -agentpath:&lt;pathname&gt;[=&lt;options&gt;]
                    load native agent library by full pathname
      -javaagent:&lt;jarpath&gt;[=&lt;options&gt;]
                    load Java programming language agent, see java.lang.instrument
      -splash:&lt;imagepath&gt;
                    show splash screen with specified image
  See http://www.oracle.com/technetwork/java/javase/documentation/index.html  for more details.
  </code></pre>
  
  <p>As no jar is created at the time of build the deployment is failing.
  While the project in the sample repository <a href="https://github.com/jboss-openshift/openshift-quickstarts" rel="nofollow noreferrer">https://github.com/jboss-openshift/openshift-quickstarts</a> works fine.
  I tried Heroku to host my app. It works fine in <a href="https://www.heroku.com/" rel="nofollow noreferrer">Heroku</a>. 
  But not working in Openshift. Please tell me what am I missing.</p>