<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>Heroku - Tag - Arkadios Tsamourliadis</title><link>http://arkadios.me/tags/heroku/</link><description>Heroku - Tag - Arkadios Tsamourliadis</description><generator>Hugo -- gohugo.io</generator><language>en-us</language><lastBuildDate>Mon, 10 Aug 2015 00:00:00 +0000</lastBuildDate><atom:link href="http://arkadios.me/tags/heroku/" rel="self" type="application/rss+xml"/><item><title>Heroku Java example</title><link>http://arkadios.me/post/heroku-java-example/</link><pubDate>Mon, 10 Aug 2015 00:00:00 +0000</pubDate><author>Arkadios Tsamourliadis</author><guid>http://arkadios.me/post/heroku-java-example/</guid><description><![CDATA[<p>Here <a href="https://github.com/atsamour/Heroku-java-example" target="_blank" rel="noopener noreffer ">https://github.com/atsamour/Heroku-java-example</a> you can find a sample Java web project for <a href="https//www.heroku.com" rel="">Heroku</a> PaaS cloud. You can also run it locally with only JRE and Maven installed, as it doesn&rsquo;t requre a seperate application container. It evaluates Heroku&rsquo;s <a href="http://github.com/jsimone/webapp-runner" target="_blank" rel="noopener noreffer ">open source</a> with embedded Tomcat.</p>
<h2 id="to-run-locally">To run locally</h2>
<p>First you have to git pull the repo to your PC, then build the application running this command from the local project folder:</p>
<pre><code>:::term
$ mvn package
</code></pre>
<p>And then you just run the application by using the java command:</p>
<pre><code>:::term
$ java -jar target/dependency/webapp-runner.jar target/*.war
</code></pre>
<p>If everything worked correctly, your application should be accessible at <code>localhost:8080</code>.</p>
<h2 id="to-run-on-heroku-cloud">To run on Heroku cloud</h2>
<p>First create a Heroku account, install Heroku Toolbelt as described <a href="https://devcenter.heroku.com/articles/getting-started-with-java#set-up" target="_blank" rel="noopener noreffer ">here</a>, then deploy the app on Heroku as described <a href="https://devcenter.heroku.com/articles/getting-started-with-java#deploy-the-app" target="_blank" rel="noopener noreffer ">here</a>.
If everything worked correctly, your should see the application in your browser.</p>
<h3 id="to-deploying-a-jar-filer-that-doesnt-exist-at-maven-repository">To deploying a jar filer that doesn&rsquo;t exist at Maven repository</h3>
<p>Download and put the .jar (e.g.) file to the project&rsquo;s folder (e.g. C:\Users\username\Dropbox\heroku-examples\appfolder)
Then call mvn deploy:deploy-file to actually deploy the jar to <code>repo</code> folder:</p>
<pre><code>:::term
mvn deploy:deploy-file -Durl=file:///C:\Users\username\Dropbox\heroku-examples\appfolder\repo\ -Dfile=json-taglib-0.4.1.jar -DgroupId=atg.taglib.json -DartifactId=json-taglib -Dpackaging=jar -Dversion=0.4.1
</code></pre>
<p>You are ready to add this dependancy to your main pom file as any other.
more info here: <a href="https://maven.apache.org/guides/mini/guide-3rd-party-jars-remote.html" target="_blank" rel="noopener noreffer ">https://maven.apache.org/guides/mini/guide-3rd-party-jars-remote.html</a>, <a href="https://devcenter.heroku.com/articles/local-maven-dependencies" target="_blank" rel="noopener noreffer ">https://devcenter.heroku.com/articles/local-maven-dependencies</a>s</p>
]]></description></item></channel></rss>