Micronaut app with Oracle autonomous TODO

Micronaut app with Oracle autonomous TODO

Authors: Todd Sharp

Micronaut Version: 2.0.2

1 Getting Started

In this guide we are going to create a Micronaut app written in Java.

2 What you will need

To complete this guide, you will need the following:

  • Some time on your hands

  • A decent text editor or IDE

  • JDK 1.8 or greater installed with JAVA_HOME configured appropriately

3 Solution

We recommend you to follow the instructions in the next sections and create the app step by step. However, you can go right to the completed example.

or

Then, cd into the complete folder which you will find in the root project of the downloaded/cloned project.

4 Writing the App

Create an app using the Micronaut Command Line Interface.

mn create-app example.micronaut.complete

The previous command creates a micronaut app with the default package example.micronaut in a folder named complete.

By default, create-app creates a Java Micronaut app that uses the Gradle build system. However, you could use other build tools such as Maven or other programming languages such as Groovy or Kotlin.

If you are using Java or Kotlin and IntelliJ IDEA make sure you have enabled annotation processing.

annotationprocessorsintellij

Create a micronaut application using the CLI:

% mn create-app example.micronaut.complete
launch

5 Testing the Application

To run the tests:

$ ./gradlew test
$ open build/reports/tests/test/index.html

6 Running the Application

To run the application use the ./gradlew run command which will start the application on port 8080.

7 Next steps

Read more about Micronaut Oracle Cloud.

TODO add a link to autonomous documentation