« Return to Thread: Overriding properties in a dependency's pom.xml

Overriding properties in a dependency's pom.xml

by mraible :: Rate this Message:

Reply to Author | View in Thread

I have a project that has <dao.framework>hibernate</dao.framework> defined as a property in the root pom.xml. In a "service" project, that property is used as follows:

        <dependency>
            <groupId>${pom.groupId}</groupId>
            <artifactId>appfuse-${dao.framework}</artifactId>
            <version>${pom.version}</version>
        </dependency>

In turn, the service dependency is used in WAR projects:

        <dependency>
            <groupId>${pom.groupId}</groupId>
            <artifactId>appfuse-service</artifactId>
            <version>${pom.version}</version>
            <exclusions>
        </dependency>

From here, child projects use this WAR project (it's overlayed).  We're using the Maven WarPath plugin (http://static.appfuse.org/plugins/maven-warpath-plugin/) to read dependencies from WARs.

For some reason, if I put <dao.framework>ibatis</dao.framework> in my child project, it doesn't override the variable in the service/pom.xml.  However, if I pass in -Ddao.framework=ibatis from the command-line, everything works.  

Is it possible to override property values in child projects - or is it only possible from the command-line?  My child project does not refer to any other projects as parent projects.

Matt

 « Return to Thread: Overriding properties in a dependency's pom.xml