You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Michael Osipov (Jira)" <ji...@apache.org> on 2022/01/07 20:21:00 UTC

[jira] [Closed] (MNG-6746) Maven 3.6.1 does not resolve ${revision} if defined within parent section and when parent pom is externally sourced

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

Michael Osipov closed MNG-6746.
-------------------------------
    Resolution: Invalid

As [~khmarbaise] already layed out. This usecase is not supported.

> Maven 3.6.1 does not resolve ${revision} if defined within parent section and when parent pom is externally sourced
> -------------------------------------------------------------------------------------------------------------------
>
>                 Key: MNG-6746
>                 URL: https://issues.apache.org/jira/browse/MNG-6746
>             Project: Maven
>          Issue Type: Bug
>          Components: POM
>    Affects Versions: 3.6.1
>            Reporter: Vasiliy
>            Priority: Major
>              Labels: features
>
> *Current Behavior*
> Create a parent maven project "top" pom (corporate pom) with version "1.0.0-SNAPSHOT" like this:
>  
> {code:java}
> <groupId>com.test</groupId>
> <artifactId>top</artifactId>
> <version>${revision}</version>
> {code}
>  
> Execute the following
> {code:java}
> mvn -Drevision=1.0.0-SNAPSHOT install{code}
> Create another mvn project "child-repo" and provide the pom like this:
>  
> {code:java}
> <groupId>com.test</groupId>
> <artifactId>child-repo</artifactId>
> <version>${revision}</version>
> <parent>
>   <groupId>com.test</groupId>
>   <artifactId>top</artifactId>
>   <version>${revision}</version>
>   <relativePath/> 
> </parent>
> {code}
>  
>  
> I get an error
> {noformat}
> Non-resolvable parent POM for com.test:top:${revision}: Could not transfer artifact com.test:top:pom:${revision} from/to nexus ($NEXUS)URL/content/groups/public): Failed to transfer file $NEXUS_URL/com/test/top/$%7Brevision%7D/top$%7Brevision%7D.pom with status code 400 and 'parent.relativePath' points at wrong local POM @ line 12, column 10 -> {noformat}
> The only way to resolve is to also checkout the "top" project and keep at the same level as "child-repo" project and add the following to child-repo's parent section.
> {code:java}
> <relativePath>../top</relativePath>{code}
> *Expected Result*
> I would like Maven to resolve the "top" repo from the mvn repository directly instead of having it refer it via relativePath.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)