Maven properties are value placeholders, like properties in Ant. Their values are accessible anywhere within a POM by using the notation ${X}, where X is the property. Or they can be used by plugins as default values, for example: In your case you have defined properties as version of java.
Maven supports project inheritance. You can create a parent project that contains properties child projects have in common, and child projects inherit those properties from the parent project.
Custom Properties It can define the properties on pom. xml between <properties></properties> tags.
I'm defining a report configuration in my parent pom which will be run in each child and grandchild project.
Like so:
<reporting>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<version>1.2</version>
<configuration>
<xmlOutput>true</xmlOutput>
<threshold>Low</threshold>
<effort>Min</effort>
<includeFilterFile>${basedir}/findbugsFilter.xml</includeFilterFile>
</configuration>
</plugin>
</plugins>
</reporting>
The trouble is that each child inserts its basedir
rather than the defining POM. I suppose I'm looking for the equivalent to ANT's <property name="name" location="${basedir}"/>
.
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