In these dark days, we find ourselves listlessly longing for order. Therefore, let us create an application that brings us a beautiful to-do list. For this exciting prospect, I plan to use the following stack:
- Windows 8.1;
- Java EE, REST;
- Grunt; and
Lest we swallow the elephant whole, I’d rather we broke this down into a series of posts. That way, we maintain sanity across the board. In this post I will set up the back-end skeletal framework of the project.
If we are able to see
Hello World! on a local running instance of Wildfly, that would signal success, and we then ought to smugly look back and reminisce over our journey. And then move on.
Now, cunningly, when I open Eclipse, we immediately notice that I have the M2Eclipse (Maven) plugin pre-installed. This would be the case for you too if you chose the Eclipse edition for Java EE developers. However, if you do find your Eclipse instance is without the joy that Maven brings, you would simply need to add http://download.eclipse.org/technology/m2e/releases to your software update sites and install the software. Information on how to do this is available here.
I start by following
File -> New -> Maven Project, wanting to create a new project from a Maven archetype. To enable this, I need to have added the appropriate catalog for Wildfly archetypes:
Once this is in place, I proceed to create the project, selecting the latest version available, opting for the whole deal, an EAR project:
I swiftly complete the archetype parameters, self-righteously using my own name, like so:
The project is then nicely created in the workspace as 4 separate projects (
For our test, I create a class called
Test.java inside the
todo-web project in the
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
Then we go on to install Wildfly, starting by downloading the latest version as a zip file and extracting it to
Next we update the environmental variables, setting:
JAVA_HOMEto the Java root installation folder. I’m using a JDK
PATHto include wildfly:
Next we open a terminal (cmd) and add an admin user for the server:
Follow the instructions to add your management user, making a note of the username and password you select.
Now we give the server a kick, by simply typing:
in the terminal.
If you have Maven installed on your machine, you would now open another terminal and change the directory to the root of our
todo project, and type:
mvn clean install wildfly:deploy
You could perform the same operation from within Eclipse by specifying a Run Configuration based on a Maven Build:
Now, we eagerly open the browser, point it to
localhost:8080/todo-web/rest/test, and we find our very Holy Grail:
My next post will deal with creating the actual REST services for our todo application. Thank you for reading!