Since MapStruct version 1.3.0.Final is out, we are able to better integrate with Lombok Builder pattern.
MapStruct is a library that takes away a lot of boilerplate code for mapping between POJO’s.
With MapStruct there is no need for implementing the real mapping itself.
With Lombok we can use a Builder
pattern and mark an object as a Value
(Object). It will result in an immutable object.
This blog post shows how we can use MapStruct to use the Builder
pattern of Lombok.
Continue reading →
I like to create immutable classes. When using Lombok we can easily create immutable classes.
This class Person with the @Value
annotation will create an immutable class with an all args constructor.
The @Builder
will add a Builder pattern to the Person class, so I can use it like this:
Continue reading →
From time to time you only want to run one test, one test method, one class or one package from the command-line.
Or on the contrary: you want to exclude / ignore one specific test or group of tests during the build cycle.
Excluding tests from the build cycle by the command line usually occurs when the following scenarios meet:
-
A test requires significant amount of resources (time, memory, disk space, etc.)
-
The run needs to be independent from the IDE (to reenact the Continuous Integration / Continuous Delivery pipeline) as some IDEs load test-dependencies on the compile-time class-path.
-
You have no or limited ability to change the code-base
Continue reading →
With a Spring (Boot/Cloud) application you can create a fully executable JAR, where the jar can be run from the command-line by just calling ./my-own-jar-0.0.1.jar
.
My colleague Mr. Haki wrote Grails Goodness: Creating A Fully Executable Jar.
Together with the famous one-liner of Josh Long in mind: "Make JAR not WAR!", create a JAR whenever you develop a Spring Boot/Cloud application.
As described in Mr. Haki's blog, it is very easy to make our Spring application executable:
org.springframework.boot
spring-boot-maven-plugin
true
## Gradle configuration
```gradle
apply plugin: 'spring-boot'
springBoot {
executable = true
}
Continue reading →