Model Validations 3.0.0 - Transmutations 2.0.0
These versions simplified the setup for projects with validation rules and transmuters. However, this breaks the previous setup. When upgrading to the new versions, make sure you also update follow the migration guide below.
Changes and Improvements
Both Model Validations and Model Transmutations have been refactored to make configuration easier.
The annotation processors are now defined in the validations-core
and modelTransmutations-core
jars and no longer
need to be explicitly added to your maven builds.
<plugins>
<plugin>
<groupId>net.democritus.maven.plugins</groupId>
<artifactId>expanders-maven-plugin</artifactId>
<version>${expanders-maven-plugin.version}</version>
<executions>
<execution>
<goals>
<goal>expansionResource</goal>
</goals>
<configuration>
<includeClassPathDependencies>true</includeClassPathDependencies>
</configuration>
</execution>
</executions>
</plugin>
<!-- Remove this -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.10.0</version>
<configuration>
<showWarnings>true</showWarnings>
<annotationProcessors>
<annotationProcessor>
net.democritus.transmutations.compilation.TransmutationAnnotationProcessor
</annotationProcessor>
</annotationProcessors>
</configuration>
</plugin>
...
</plugins>
Furthermore, the generated DataResources are generated in the new format.
Migration
Update your expanders-maven-plugin to 2023.3.1 or higher:
<expanders-maven-plugin.version>2023.3.1</expanders-maven-plugin.version>
Next, remove the DataResource reference in your _data.xml
file:
<dataResources>
...
<!-- Remove these -->
<dataResource>
<path>data/transmutations/modelTransmutations.xml</path>
<elementTypeCanonicalName>net.democritus.transmutations.ModelTransmutation</elementTypeCanonicalName>
</dataResource>
<dataResource>
<path>data/validations/validationGroups.xml</path>
<elementTypeCanonicalName>net.democritus.validations.ValidationGroup</elementTypeCanonicalName>
</dataResource>
</dataResources>