Peter Lord created MNG-6271:
-------------------------------

             Summary: pom with parent and variable in repository url fails
                 Key: MNG-6271
                 URL: https://issues.apache.org/jira/browse/MNG-6271
             Project: Maven
          Issue Type: Bug
            Reporter: Peter Lord


With the following pom.xml :

{code}
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>

    <modelVersion>4.0.0</modelVersion>

    <groupId>com.company</groupId>
    <artifactId>project</artifactId>
    <version>1.0.0</version>
    <name>hello world</name>

    <properties>
        <x>/Users/plord/repo</x>
    </properties>

    <parent>
        <groupId>com.company</groupId>
        <artifactId>parent</artifactId>
        <version>10.2.0-SNAPSHOT</version>
    </parent>

    <repositories>
        <repository>
            <id>repo</id>
            <url>file://${x}/sdk/maven/repo</url>
        </repository>
    </repositories>

</project>
{code}

maven fails to resolve the variable before attempting to download the parent.  
Output includes :

{code}
$ mvn install
[INFO] Scanning for projects...
Downloading: 
file://${x}/sdk/maven/repo/com/company/parent/10.2.0-SNAPSHOT/maven-metadata.xml
[WARNING] Could not transfer metadata 
com.company:parent:10.2.0-SNAPSHOT/maven-metadata.xml from/to repo 
(file://${x}/sdk/maven/repo): Repository path /sdk/maven/repo does not exist, 
and cannot be created.
Downloading: 
file://${x}/sdk/maven/repo/com/company/parent/10.2.0-SNAPSHOT/parent-10.2.0-SNAPSHOT.pom
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[FATAL] Non-resolvable parent POM for com.company:project:1.0.0: Could not 
transfer artifact com.company:parent:pom:10.2.0-SNAPSHOT from/to repo 
(file://${x}/sdk/maven/repo): Repository path /sdk/maven/repo does not exist, 
and cannot be created. and 'parent.relativePath' points at wrong local POM @ 
line 16, column 13
 @ 
{code}

The same is true if the variable is from the environment or system property.

Maven should resolve variables before attempting to download parent pom.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to