How can I use maven properties in site APT files? For example I want to use ${project.version} in the index.apt so I can always refer to the latest version without manually changing the index.apt file before deploying the site.
Maven supports a great set of property references. In pom.xml it can get the os configured properties, Java properties. You can also define your own properties on the parent pom and can refer those properties from the child. Let's discuss each of them here These are the properties defined in the os level environment variables.
maven Built-in Plugin Properties Each plugin has a set of built in properties. For a reference of these properties, you can find a "Properties" link in the left hand navigation of the plugin documentationof each individual plugin. Last published: 03 February 2008 08:50 CET
For accessing the Environmental properties, add the prefix env before the variable like follows. By default, the maven provides the feature to get the project related properties Such as groupId, artifactId, version the project. For accessing these properties, you need to add the prefix project before the variable. Say example.
The settings.xml is the core file of maven. It generally appears on the conf folder of maven_home. All core maven configurations placed inside of the settings.xml file. Also on settings.xml file, it is able to define properties under the profiles, those properties can access from any project running under that maven
Found it. Just had to rename the apt files to *.apt.vm. Maven then pipes the files through Velocity which can process the properties.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With