Porting Oracle’s “First Cup” Tutorial to Wildfly / JBoss

  JBoss, Tutorial, Wildfly

What is in the Oracle Java EE 7 SDK

You should have installed the required software by  now, so let’s jump right into the original First Cup tutorial source code which comes with the downloaded java_ee_sdk-7u2.zip file. It is a good idea to extract it to your desktop as we may need to look into it a few times. As a matter of fact, we don’t need the sources at all but the custom maven archetypes which are included. These archetypes are contained in source code, so we need to compile them and install them into our local maven repository. Although you could skip this step, it would require you to either manually set up the needed project structures later, or use one of the standard maven archtypes like maven-archetype-jee-simple and give it a finishing touch in order to match our targeted project structure.

For simplicity sake, we use the archetypes in the Java EE 7 SDK download file. If you fully unzipped the file to your desktop, go into /glassfish4/docs/firstcup/example/archetypes. There you see two folders, each containing a custom archetype source package. If you press and hold the shift-key on your keyboard and right-click on the ‘dukes-age-archetype’ folder, the context menu will offer you to open a terminal window already pointing to this folder. In the terminal, you just need to enter the mvn install command and the archetype is compiled, bundled and installed in your local maven repository. Do the same for the other custom archetype folder ‘firstcup-war-archetype’.

Admittedly, these custom archetypes have been designed with NetBeans in mind, so when used during project creation, we’ll have to fix a few glitches afterwards.

One last word about the content of ‘java_ee_sdk-7u2.zip’. Although it includes the complete source code, we won’t use it at all in this tutorial, simply because the Oracle tutorial depends on the initially created artifacts by incrementally explaining and manually completing the code. Therefore, you MUST read the Oracle tutorial and follow the coding instructions to fully understand the Java EE 7 concepts behind it. Fortunately, Oracle has consequently seperated the NetBeans project setup and configuration from the coding parts, so you can easily skip their project setup stuff because this is exactly what my tutorial is about: Guiding you through the project setup using JBoss Developer Studio and Wildfly. Therefore, I recommend to start the Oracle tutorial at chapter 2.1. From then on, just skip project setup details as you come across them.

LEAVE A COMMENT