1

I am trying to build a project with a dependency like this:

<dependency>
    <groupId>com.foo.bar</groupId>
    <artifactId>packageA</artifactId>
    <version>${branch}-3.2.4.25.2</version>
</dependency>

The pom for com.foo.bar.packageA has a dependency like this:

<properties>
    <branch>DEV</branch> <!-- default value -->
</properties>
<dependencies>
    <dependency>
        <groupId>org.baz</groupId>
        <artifactId>packageB</artifactId>
        <version>${branch}-3.2.4.25.2</version>
    </dependency>
</dependencies>

I build with the command:

mvn clean install -Dbranch=Iago

The dependency for com.foo.bar.packageA is resolved as I expect: Iago-3.2.4.25.2. However, the dependency for org.baz.packageB is resolved as: DEV-3.2.4.25.2. Am I not correct in thinking that the branch property with value DEV should be overridden with my command-line value of Iago?

Jason
  • 406
  • 1
  • 5
  • 16
  • 1
    I don't think you can overridden property of dependency pom. see this link : http://stackoverflow.com/questions/13708738/how-to-get-a-command-line-property-to-overwrite-a-maven-property – vahid Dec 14 '16 at 20:58
  • Hey thanks, this seems to be the case. If you make it the answer I'll accept it. – Jason Dec 15 '16 at 14:20

0 Answers0