The Templating Maven Plugin copies the files of a template directory to an output directory while filtering them, and adds the output directory as a source root. Use it to put values such as POM properties into Java source code, for example into annotation constants. It requires Maven 3.9.0 or later and Java 8 or later.
Put the templates in src/main/java-templates (or src/test/java-templates for test sources) and bind the goals:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>templating-maven-plugin</artifactId>
<version><!-- latest release --></version>
<executions>
<execution>
<id>filter-src</id>
<goals>
<goal>filter-sources</goal>
</goals>
</execution>
</executions>
</plugin>The usage guide and the goal parameters are on the plugin site. See AGENTS.md for build, test and pull request conventions.
- Make sure
gpg-agentis running. - Execute
mvn -B release:prepare release:perform
For publishing the site do the following:
cd target/checkout
mvn verify site site:stage scm-publish:publish-scm