Skip to main content

Expanders Maven Plugin 2023.3.0

· One min read
Koen De Cock
Koen De Cock
R&D Engineer

Changes and Improvements

The plugin has been refactored to support an easier way to register data-resources with the expansionResource goal.

With the latest version, you can create an XML file with dataResource as root tag and a type attribute:

<dataResource type="elements::Technology">
<technology name="HSQLDB">
<subdir>hsql</subdir>
<concernType name="DATABASE"/>
<description>-</description>
</technology>
<technology name="MARIADB">
<subdir>mariadb</subdir>
<concernType name="DATABASE"/>
<description>MariaDB Database</description>
</technology>
<technology name="POSTGRESQL">
<subdir>postgresql</subdir>
<concernType name="DATABASE"/>
<description>PostgreSQL Database</description>
</technology>
</dataResource>

The file should still be placed in a resources directory or another directory that is included in the build. The expansionResource mojo will scan through the target/classes directory to find these files and register them. Because of this change, we no longer need a _data.xml file to describe the locations of the data-resources.

changes

To make this change possible, 2 changes have been made to the expansionResource mojo:

  • The mojo now runs on the process-classes phase instead of generate-resources. This allows us to find files copied by the generate-resources step, or created during compilation (e.g. by annotation processors, such as for ValidationRules).
  • The default rootDirectory is now ${project.build.outputDirectory} instead of ${project.baseDir}/src/main. This directory is used to find Expanders, Features, DataResources etc. The behaviour should be the same.