[ 
https://issues.apache.org/jira/browse/MNG-6457?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16588568#comment-16588568
 ] 

Robert Scholte commented on MNG-6457:
-------------------------------------

I'm not convinced this is a valid case. If such a pom is consumed by a project 
and that system doesn't have this environment variable, it cannot find that 
parent.
It will also overcomplicate the resolution, see 
https://maven.apache.org/ref/3.5.4/maven-model-builder/ . Here you see that 
{{parent resolution}} is done before {{model interpolation}}. If we would allow 
this, we need to do early interpolation of environment variables and probably 
only for a few segments in the pom.


> Resolving repository with an environment variable substitution fails when a 
> parent pom needs to be looked up
> ------------------------------------------------------------------------------------------------------------
>
>                 Key: MNG-6457
>                 URL: https://issues.apache.org/jira/browse/MNG-6457
>             Project: Maven
>          Issue Type: Bug
>          Components: Artifacts and Repositories
>    Affects Versions: 3.3.3, 3.5.2
>         Environment: ubuntu 18.04, also with windows 10
>            Reporter: Martin Knoller Stocker
>            Priority: Major
>
> Having a repository entry with a environment variable substitution like 
>  
> {code:java}
> <repositories>
> <repository>
> <id>company-java-libs</id>
> <url>https://packagecloud.io/priv/${env.PACKAGECLOUD_JAVA_LIBS_READ_TOKEN}/company/java-libs/maven2</url>
> <releases>
> <enabled>true</enabled>
> </releases>
> <snapshots>
> <enabled>true</enabled>
> </snapshots>
> </repository>
> </repositories>
> {code}
> and a parent entry that is not present in your local repository
> {code:java}
>   <parent>
>     <groupId>company</groupId>
>     <artifactId>a-parent-module</artifactId>
>     <version>1.0.0</version>
>     <relativePath/> <!-- lookup parent from repository -->
>   </parent>
> {code}
> produces a parsing error when running maven commands:
> {code:java}
> [ERROR] [ERROR] Some problems were encountered while processing the POMs:
> [ERROR]     Non-resolvable parent POM for __current_project_version__: Could 
> not transfer artifact company:a-parent-module:pom:1.0.0 in company-java-libs  
> from/to company-java-libs 
> (https://packagecloud.io/priv/${env.PACKAGECLOUD_JAVA_LIBS_READ_TOKEN}/company/java-libs/maven2):
>  Illegal character in path at index 30: 
> https://packagecloud.io/priv/${env.PACKAGECLOUD_JAVA_LIBS_READ_TOKEN}/company/java-libs/maven2/__path__
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to