I have the following directory structure.

.
|-- my-module
|   `-- pom.xml
`-- parent
    `-- pom.xml


The my-module pom.xml is defined as:

<project>
 <parent>
   <groupId>com.mycompany.app</groupId>
   <artifactId>my-app</artifactId>
   <version>${test.version}</version>
   <relativePath>.../parent/pom.xml</relativePath>
 </parent>
 <modelVersion>4.0.0</modelVersion>
 <artifactId>my-module</artifactId>
</project>


and the parent pom.xml is defined as:

<project>
 <modelVersion>4.0.0</modelVersion>
 <groupId>com.mycompany.app</groupId>
 <artifactId>my-app</artifactId>
 <version>${test.version}</version>
</project>

To build them i execute mvn clean install -Dtest.version=1.0 in parent 
directory which works fine. But when i execute mvn clean install 
-Dtest.version=1.0 in my-module directory it shows the following error
[INFO] Unable to find resource 'com.mycompany.app:my-app:pom:${test.version}' 
in repository central (http://repo1.maven.org/maven2) [INFO] 
------------------------------------------------------------------------ 
[ERROR] FATAL ERROR [INFO] 
------------------------------------------------------------------------ [INFO] 
Error building POM (may not be this project's POM).

Is it not allowed to specify a property variable while specifying parent pom 
definition.

--
Anurag

Reply via email to