We have a multi-module maven project, and it has different platforms to run on, like JBoss 4 and JBoss 7. We specify the platform
property, and then use it as a classifier for artifacts, and for activation of the platform-specific profile in sub-modules, like:
<activation>
<property>
<name>platform</name>
<value>jboss71x</value>
</property>
</activation>
in these profiles, we, among other things, specify the versions of provided dependencies. E.g. we do import of jboss parent pom:
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.jboss.as</groupId>
<artifactId>jboss-as-parent</artifactId>
<version>${dependencies.jbossas7.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
So when we specify the property as a command-line argument (-Dplatform=jboss71x
), it works OK.
But when the property is set in <properties>
section in root pom.xml (I also tried to set it in parent pom), looks like the versions from parent pom are missed:
[ERROR] 'dependencies.dependency.version' for commons-lang:commons-lang:jar is missing. @ line 46, column 21
[ERROR] 'dependencies.dependency.version' for commons-beanutils:commons-beanutils:jar is missing. @ line 56, column 21
[ERROR] 'dependencies.dependency.version' for commons-collections:commons-collections:jar is missing. @ line 61, column 21
The maven version is latest: 3.2.1.
Why this happens, and how can we specify this property value in pom.xml, not in command line?