[ 
https://jira.codehaus.org/browse/MNG-5099?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Benjamin Bentmann updated MNG-5099:
-----------------------------------

    Attachment: MNG-5099.zip

I'm not able to reproduce this using a concrete project like the one attached. 
After installing deps/pom.xml and lib/pom.xml, otherlib is able to resolve the 
mysql dependency using the propery inherited via the parent.

> Issue with properties inherited from parent POM
> -----------------------------------------------
>
>                 Key: MNG-5099
>                 URL: https://jira.codehaus.org/browse/MNG-5099
>             Project: Maven 2 & 3
>          Issue Type: Bug
>          Components: Inheritance and Interpolation
>    Affects Versions: 3.0.3
>         Environment: java 1.6.0_24
>            Reporter: Dan Checkoway
>         Attachments: MNG-5099.zip
>
>
> This worked absolutely fine in 2.2.1.  Fails in 3.0.3.
> ./deps/pom.xml has:
>   <properties>
>     <mysql.connector.version>5.1.16</mysql.connector.version>
>   </properties>
> ./library/pom.xml has:
>   <parent>
>     <groupId>com.mycompany</groupId>
>     <artifactId>base</artifactId>
>     <version>1.0</version>
>     <relativePath>../deps/pom.xml</relativePath>
>   </parent>
> ...
>     <dependency>
>       <groupId>mysql</groupId>
>       <artifactId>mysql-connector-java</artifactId>
>       <version>${mysql.connector.version}</version>
>       <scope>runtime</scope>
>     </dependency>
> ./otherlib/pom.xml has:
>     <dependency>
>       <groupId>com.mycompany</groupId>
>       <artifactId>mycompany-library</artifactId>
>       <version>1.0</version>
>       <scope>compile</scope>
>     </dependency>
> cd library
> mvn deploy (all good)
> cd otherlib
> mvn compile (fails)
> [ERROR] Failed to execute goal on project mycompany-otherlib: Could not 
> resolve dependencies for project com.mycompany:mycompany-otherlib:jar:1.0: 
> Failure to find mysql:mysql-connector-java:jar:${mysql.connector.version} in 
> http://repo1.maven.org/maven2 was cached in the local repository, resolution 
> will not be reattempted until the update interval of central has elapsed or 
> updates are forced -> [Help 1]
> It's as if it's treating the ${mysql.connector.version} in the runtime 
> dependency literally, instead of resolving that property.
> I can work around this by adding this to library/pom.xml:
>   <properties>
>     <mysql.connector.version>5.1.16</mysql.connector.version>
>   </properties>
> Please let me know if I'm missing something simple, but it worked fine 
> without the workaround in 2.2.1, and this looks like a bug to me!

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to