This post shows how to deploy a Java EE application on a WildFly or JBoss EAP 7 via the WildFly Maven Plugin1. You can use this plugin to deploy, undeploy or run your application. The post has two parts:

  • deploy application on local server
  • deploy application on remote server via https
Continue Reading ...

This is not the first time I need to install and configure a MySql Community Server on a fresh system with Ubuntu (16.04) running on it. So instead next time to have to google for the individual steps again, I decided to write a post. Find out also how to tweak the Server configuration.

Continue Reading ...

This post describes how to develop a Java EE REST service, usually part of a REST API backend, that will provide information about the current version of the implementation plus the git sha-1 number1. This can be very useful in continuous delivery2 scenarios or for the operations team, where they make a smoke test after deployment to “humanly see” if the API is “alive”, plus one gets which version/commit is currently deployed. The post implies you are also using Maven3 to build your project

So when making a GET REST call against the service:

GET http://localhost:8080/some-root-context/version

I would expect something like the following

{
   "version": "1.2.0",
   "gitSha1": "8f0b7f7e1fc0d"
}

where the version attribute displays the version of the project from the pom.xml4 file and the gitSha1 attribute contains the first, let’s say 13 characters of the SHA-1 calculated from the git commit that corresponds to this deployment.

Generally, eight to ten characters are more than enough to be unique within a project, but I choose thirteen just to be sure :)

You can then use the gitSha1 value with the git show command to show the corresponding commit:

$ git show 8f0b7f7
commit 8f0b7f7e1fc0dcde3ccc0a9418f37a698dabb3b7
Merge: df736ab 3ebcbdb
Author: Adrian Matei <ama@codingpedia.org>
Date:   Sat Dec 3 09:30:41 2016 +0100

    Merge branch 'master' of https://github.com/Codingpedia/codingpedia.github.io

Continue Reading ...

The codingmarks are persisted in a MongoDB Server. Very often I find myself in the situation, where I need to modify or look for something in the mongo database. Experience has taught me that interacting with a system via shell commands helps me understand it better, and sort of brings me closer to it. Ok, so how to find the right mongo shell command? Well, I google for it of course, and most likely I am pointed to the right entry in the Mongo manual. In this post I try to consolidate the commands I usually use, so that I have only one codingmark to look for…

Octocat Source code for codingmarks.org is available on Github - frontend and backend.

Continue Reading ...

In this post I will shortly present how to enable the provided RESTEasy CORS Filter in a REST API backend application. Well, it is officially documented, but for me was not that straightforward to use it and I want to share how I accomplished this. If you are new to CORS and want to learn more about it I suggest you read the document from Mozilla Developer Network - HTTP access control (CORS).

Continue Reading ...