Creating the source code

We have installed and configured everything that's necessary to create our microservice for the management of the registry of fantasy manager. Now, it's time to write the code that's needed to expose our microservice APIs.

We will follow the same steps that were described for the football players' microservice:

  1. We will connect to the Thorntail project generator utility, http://wildfly-swarm.io/generator/, in order to get our project skeleton to work on, and we will select the following dependencies:
    • JAX-RS
    • CDI
    • JPA
    • JTA
  2. We will use com.packtpub.thorntail as the Maven Group ID of the project, and fantasy-player-microservice as the Artifact ID.
  3. Click on Generate Project to create and download the ZIP file with the project skeleton.
  4. Unzip the file in a directory of your choice, and open the Maven project with your favorite IDE (Eclipse, NetBeans, IntelliJ, and so on).

Remember to perform the following important steps:

  1. Change the value of the BOM from bom-all to bom, in order to only include the stable fractions that are recommended for daily use.
  2. Change the value of the project name from Thorntail Example to Thorntail Football manager microservice.
  3. Change the final name of the artifact, created in the build phase, from demo to football-manager-microservice.
  4. Now, launch the first build with the following command:
$ mvn clean package 

In this way, we will download all of the dependencies and create the WAR artifact named football-manager-microservice.war and the Uber executable JAR file, football-manager-microservice-thorntail.jar.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset