Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Nested Maven properties evaluated in referring POM rather than defining POM

Tags:

People also ask

What is properties in Maven POM xml?

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.

Are Maven properties inherited?

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.

Where do I put properties tag in POM xml?

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}"/>.