Jib is an open-source Java library from Google for creating Docker images for Java applications. Jib can be used as Maven or Gradle plugin in our Spring Boot project. One of the nice feature of Jib is that it adds layers with our classes, resources and dependency libraries for the Docker image. This means that when only class files have changed, the classes layer is rebuild, but the others remain the same. Therefore the creation of a Docker image with our Spring Boot application is also very fast (after the first creation). Also the Maven and Gradle plugins have sensible defaults, like using the project name and version as image name, so we don’t have to configure anything in our build tool. Although Jib provides options to configure other values for the defaults, for example to change the JVM options passed on to the application.
Archive: September 2018
Document attributes in Asciidoctor are very powerful. We can assign values to a document attributes and reference the attribute name in our document enclosed between curly braces. Asciidoctor will fill in the value when the document is transformed. Instead of a plain value we can also use styling markup in the document attribute definition. We must use the passthrough macro and allow for quote substitution.
When we use the Micronaut command line commands to generate controllers, beans and more, the classes will have a default package name.
We can use a fully qualified package name for the class we want to generate, but when we only define a class name, Micronaut will use a default package name automatically.
We can set the default package for an application when we first create an application with the
But we can also alter the default package name for an existing Micronaut application.
In a previous post we learned how to add build information to the
/info endpoint in our application.
We can add custom information to the
/info endpoint via our application configuration or via a bean by implementing the
Remember we need to add the
io.micronaut:management dependency to our application for this feature.