JAXB / XJC Plugin to add Lombok annotations in classes generated from an XML Schema. Annotations supported:
- https://projectlombok.org/features/Data
- https://projectlombok.org/features/GetterSetter
- https://projectlombok.org/features/GetterSetter
- https://projectlombok.org/features/EqualsAndHashCode
- https://projectlombok.org/features/ToString
- https://projectlombok.org/features/constructor
- https://projectlombok.org/features/constructor
- https://projectlombok.org/features/constructor
XJC Plugin options:
- -Xlombok - enable the plugin and use https://projectlombok.org/features/Data annotation on all classes (see below)
- -Xlombok:Data - add https://projectlombok.org/features/Data annotation and remove all getters and setters
- -Xlombok:Setter - add https://projectlombok.org/features/GetterSetter annotation
- -Xlombok:Getter - add https://projectlombok.org/features/GetterSetter annotation
- -Xlombok:GetterSetter - add [https://projectlombok.org/features/GetterSetter](@Getter and @Setter) annotations, remove all getters and setters in the process
- -Xlombok:EqualsAndHashCode - add https://projectlombok.org/features/EqualsAndHashCode annotation
- -Xlombok:ToString - add https://projectlombok.org/features/ToString annotation
- -Xlombok:AllArgsConstructor - add https://projectlombok.org/features/constructor annotation
- -Xlombok:NoArgsConstructor - add https://projectlombok.org/features/constructor annotation
- -Xlombok:Builder - add https://projectlombok.org/features/constructor annotation, which implies adding https://projectlombok.org/features/constructor and https://projectlombok.org/features/constructor annotations
Minimal configuration is just to enable this plugin:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jaxb2-maven-plugin</artifactId>
<version>2.2</version>
<dependencies>
<dependency>
<groupId>it.yobibit</groupId>
<artifactId>jaxb-lombok-plugin</artifactId>
<version>1.0.0</version>
</dependency>
</dependencies>
<executions>
<execution>
<id>xjc</id>
<goals>
<goal>xjc</goal>
</goals>
</execution>
</executions>
<configuration>
<packageName>com.company.model</packageName>
<arguments>
<argument>-Xlombok</argument> <!-- That is always required annotation -->
</arguments>
</configuration>
</plugin>