{"id":106,"date":"2018-08-05T20:42:47","date_gmt":"2018-08-05T20:42:47","guid":{"rendered":"http:\/\/www.matez.de\/?p=106"},"modified":"2018-08-05T20:42:47","modified_gmt":"2018-08-05T20:42:47","slug":"deploy-an-app-to-heroku-using-wildfly-and-postgresql-driver","status":"publish","type":"post","link":"https:\/\/www.matez.de\/index.php\/2018\/08\/05\/deploy-an-app-to-heroku-using-wildfly-and-postgresql-driver\/","title":{"rendered":"Deploy an app to Heroku using Wildfly and Postgresql driver"},"content":{"rendered":"<p>Since a <a href=\"https:\/\/devcenter.heroku.com\/articles\/heroku-postgresql\">Postgres Database<\/a> is the most simple persistent datastore at Heroku, I was trying to setup a jee application example using this SQL database. If you have already read some of my previous blogposts, I am using <a href=\"https:\/\/devcenter.heroku.com\/articles\/buildpack-api\">Buildpack API<\/a>\u00a0to deploy the application to a Dyno.<\/p>\n<p>Since I already got an example working with <a href=\"https:\/\/github.com\/mwiede\/heroku-buildpack-wildfly\">Wildfly<\/a> and <a href=\"https:\/\/github.com\/mwiede\/heroku-buildpack-wildfly-mysql\">Mysql<\/a>, it was an easy step to conduct a buildpack to install the Postgresql driver into the Wildfly container. It&#8217;s now available at\u00a0<a href=\"https:\/\/github.com\/mwiede\/heroku-buildpack-wildfly-postgresql\">https:\/\/github.com\/mwiede\/heroku-buildpack-wildfly-postgresql<\/a>.<\/p>\n<p>I also provide an example of the application, which uses maven properties to extract the database url and credentials from system properties and use them in persistence.xml.<\/p>\n<p>Here are the build and deploy steps to make it work (compare to <a href=\"https:\/\/github.com\/mwiede\/greeter#usage\">https:\/\/github.com\/mwiede\/greeter#usage<\/a>)<\/p>\n<pre>$ <span class=\"pl-s1\">git clone https:\/\/github.com\/mwiede\/greeter.git<\/span>\r\n$ <span class=\"pl-s1\"><span class=\"pl-c1\">cd<\/span> greeter<\/span><span class=\"pl-s1\">\r\n<\/span><\/pre>\n<pre><span class=\"pl-s1\">$ heroku create<\/span>\r\n$ <span class=\"pl-s1\">heroku addons:create heroku-postgresql:hobby-dev<\/span>\r\n$ <span class=\"pl-s1\">heroku buildpacks:clear<\/span>\r\n$ <span class=\"pl-s1\">heroku buildpacks:add heroku\/java<\/span>\r\n$ <span class=\"pl-s1\">heroku buildpacks:add https:\/\/github.com\/mwiede\/heroku-buildpack-wildfly<\/span>\r\n$ <span class=\"pl-s1\">heroku buildpacks:add https:\/\/github.com\/mwiede\/heroku-buildpack-wildfly-postgresql<\/span><\/pre>\n<pre><span class=\"pl-s1\">$ git push heroku master<\/span><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Since a Postgres Database is the most simple persistent datastore at Heroku, I was trying to setup a jee application example using this SQL database. If you have already read some of my previous blogposts, I am using Buildpack API\u00a0to deploy the application to a Dyno. Since I already got an example working with Wildfly &hellip; <a href=\"https:\/\/www.matez.de\/index.php\/2018\/08\/05\/deploy-an-app-to-heroku-using-wildfly-and-postgresql-driver\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Deploy an app to Heroku using Wildfly and Postgresql driver&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[28,12,23,27,17],"_links":{"self":[{"href":"https:\/\/www.matez.de\/index.php\/wp-json\/wp\/v2\/posts\/106"}],"collection":[{"href":"https:\/\/www.matez.de\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.matez.de\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.matez.de\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.matez.de\/index.php\/wp-json\/wp\/v2\/comments?post=106"}],"version-history":[{"count":1,"href":"https:\/\/www.matez.de\/index.php\/wp-json\/wp\/v2\/posts\/106\/revisions"}],"predecessor-version":[{"id":107,"href":"https:\/\/www.matez.de\/index.php\/wp-json\/wp\/v2\/posts\/106\/revisions\/107"}],"wp:attachment":[{"href":"https:\/\/www.matez.de\/index.php\/wp-json\/wp\/v2\/media?parent=106"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.matez.de\/index.php\/wp-json\/wp\/v2\/categories?post=106"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.matez.de\/index.php\/wp-json\/wp\/v2\/tags?post=106"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}