Hi,

I am facing a ambiguous problem with property resolution, specifically
the properties defined in POM. I have defined
      <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>${junit.version}</version>
        <scope>test</scope>
      </dependency>
in dependency management of my parent POM
(https://github.com/imyousuf/smart-core/blob/smart-core-0.1.8/pom.xml)

Now in my (grand) child POM
(https://github.com/smart-it/smart-cms/blob/master/code-generation/cms-codegenerator-demo/pom.xml)
I have defined the above dependency as -
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
    </dependency>
and overrides the property junit.version to 4.8.2 by -
  <properties>
    ...
    <junit.version>4.8.2</junit.version>
    ...
  </properties>

Now when I execute the projects from 2 laptops, I get 2 results - in
one it resolves to 3.8.1 and the other 4.8.2. I have run them with
'-X' the diff is as follows:

6c6
< OS name: "linux" version: "2.6.32-30-generic-pae" arch: "i386" Family: "unix"
---
> OS name: "linux" version: "2.6.28-19-generic" arch: "i386" Family: "unix"
136c136
< [DEBUG]   junit:junit:jar:4.8.2:test
---
> [DEBUG]   junit:junit:jar:3.8.1:test

Which means they have identical JDK and Maven versions.

Now I am confused which is the expected behavior, can someone please
tell me which is the correct behavior and what could have caused this
ambiguous behavior?

My maven and JDK version are -

Apache Maven 2.2.1 (r801777; 2009-08-07 02:16:01+0700)
Java version: 1.6.0_21
Java home: /opt/jdk1.6.0_21/jre
Default locale: en_US, platform encoding: UTF-8

Thank you,
-- 
Imran M Yousuf
Entrepreneur & CEO
Smart IT Engineering Ltd.
Dhaka, Bangladesh
Twitter: @imyousuf - http://twitter.com/imyousuf
Blog: http://imyousuf-tech.blogs.smartitengineering.com/
Mobile: +880-1711402557

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to