Over a million developers have joined DZone.

JavaEE 8 + Payara 5 + MicroProfile 2.1 + Docker in About a Minute

DZone 's Guide to

JavaEE 8 + Payara 5 + MicroProfile 2.1 + Docker in About a Minute

Getting started with microservices is quick and easy. All you need is a few terminal commands and you'll be up and running in under a minute.

· Microservices Zone ·
Free Resource

Thin Wars to the Rescue

It can be really easy to start on your JavaEE application. It’ll take you about a minute…

In this minute you will get a project with:

  • JavaEE 8.
  • MicroProfile 2.1.
  • Preconfigured Payara 5 full server Docker container.
  • Maven essential setup.
  • Run and build scripts for all of this.

The Minute Has Started…

Enter the code below in a terminal where you want to create your project and press enter.

mvn archetype:generate \
  -DarchetypeGroupId=nl.ivonet \
  -DarchetypeArtifactId=javaee8-payara-microprofile-archetype \
  -DarchetypeVersion=1.0 -U        

The first time you run this command, it will take just a bit more time as it will
download everything needed from the Maven central repository.

You will be asked these questions:

Define value for property 'groupId': YOUR_GROUP_ID_HERE         
Define value for property 'artifactId': helloworld          
Define value for property 'version' 1.0-SNAPSHOT: :          
Define value for property 'package' com.example: :          
Define value for property 'docker-hub-name': YOUR_DOCKER_HANDLE_HERE        

Just follow the instructions and your project will be created:

cd helloworld

This will start the project in a Docker container. The Docker container will be downloaded the first time and that might take more than the minute depending on the speed of your internet connection. After the first time, it will only take seconds.

Now go to http://localhost:8080/helloworld/rest/example and you will have a working
example HelloWorld application.


After Burner

Now you can load it into your favorite IDE and start building your own stuff. Don’t forget to read the README.md of the project to learn more about the available commands.

Have fun.

docker ,microprofile ,microservices ,java microservices ,javaee8

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}