title: How to run a jar file through Jenkins?
body: <p>I am trying to execute <code>Jarfile</code> through <code>Jenkins</code>. I succeeded in creating a <code>Jar</code> file through <code>Jenkins</code>, but I don't know how to do it after I make it. How can I run and test a project?</p>
  
  <p><strong>Project Settings in Jenkins</strong></p>
  
  <p><a href="https://i.stack.imgur.com/DpqPj.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/DpqPj.png" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/ooptJ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ooptJ.png" alt="enter image description here"></a></p>
  
  <p><strong>init_server.sh</strong></p>
  
  <pre class="lang-sh prettyprint-override"><code>echo "&gt; Check the currently running spring server pid "
   CURRENT_PID=$(ps -ef | grep java | grep zzazan* | awk '{print $2}')
  echo "$CURRENT_PID" 
   if [ -z $CURRENT_PID ]; then
  echo "&gt; No applications are currently running and will not be shut down." 
  else
  echo "&gt; kill -9 $CURRENT_PID" 
  kill -9 $CURRENT_PID
  sleep 10
  fi
   echo "&gt; Deploy new spring application!!" nohup java -jar /root/jenkinsproject/deploy/testjpaproject.jar &gt;&gt; /root/jenkinsproject/logs/springtestprojectSys.log &amp;
  </code></pre>
  
  <blockquote>
    <p>NOTE: This setting was followed by a blog post, and this is the <code>JPA</code>
    project. Use <code>build.gradle</code> and <code>application.yml</code>.</p>
  </blockquote>