I need help figuring out how to reference external properties in a child/module 
pom file.
I have tried using filters, properties-maven-plugin - all the same - the 
properties propagate to children project resources but do not resolve in the 
pom files themselves, thus causing pom validation errors.

Specific example:

my-filter.properties contains:

foo=bar

parent pom contains:

                <build>
                                ....
                                <filters>
                                                
<filter>${my.basedir}/src/main/filters/my-filter.properties</filter>
                                </filters>
                                <resources>
                                                <resource>
                                                                
<directory>src/main/resources</directory>
                                                                
<filtering>true</filtering>
                                                </resource>
                                </resources>
                </build>

child pom contains:

<[any-element]> ${foo}</[any-element]>


Expect: during initialization phase in the child project, the variable value is 
substituted with "bar".

Instead, getting this error:

[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Cannot find lifecycle mapping for packaging: '${foo}'.
Component descriptor cannot be found in the component repository: 
org.apache.maven.lifecycle.mapping.LifecycleMapping${foo}.


I am using maven 2.2.1
Any help would be appreciated!

Thanks!


-Leonid

Reply via email to