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

Karl Heinz Marbaise commented on MNG-6394:
------------------------------------------

This can't work cause your parent does not contain a definition of modules 
which is needed to have a running reactor. Or in other words this build is not 
a multi module build so it will not work having a {{${revision}}} in 
your parent definition for your child. A stand a lone project can of course use 
{{${revision}}} in it's version tag but not in it's parent version 
tag. Apart from that I don't see a real advantage of having the parent defined 
by a property?

Furthermore if you have a parent which is not located at the given location via 
{{<relativePath>..</relativePath>}} the question is what kind of project this 
is? If you need to be sure that the parent will be resolve from the repository 
the usual way to do this is to give: {{</relativePath/>}}...



> ${revision} and parent.releativePath
> ------------------------------------
>
>                 Key: MNG-6394
>                 URL: https://issues.apache.org/jira/browse/MNG-6394
>             Project: Maven
>          Issue Type: Bug
>    Affects Versions: 3.5.3
>         Environment: Ubuntu 17.10; Maven 3.5.3; Java 1.8.0_161
>            Reporter: Dorian Vallant
>            Priority: Major
>         Attachments: test-projects-flatten.jar, test-projects.jar, 
> test-projects.jar
>
>
> If the CI friendly ${revision} property is used it seems maven does not 
> simple replace the property with the given value.
> Consider the following example:
> parent-project/
>      pom.xml
>  child-project/
>      pom.xml
> parent-project/pom.xml:
>     ...
>     <groupId>my.group</groupId>
>     <artifactId>parentArtifact</artifactId>
>     <version>${revision}</version>
>     <packaging>pom</packaging>
>     ...
> child-project/pom.xml:
>   <parent>
>     <groupId>my.group</groupId>
>     <artifactId>parentArtifact</artifactId>
>     <version>${revision}</version>
>     <relativePath>../parent-project</relativePath>
>   </parent>
> If you build the child-project with 'mvn -Drevision=1.0.0-SNAPSHOT -f 
> child-project/pom.xml clean install' all works fine as long as the parent 
> project is present in the file system. But if you move the parent project to 
> another place, build & install it to your local repository and then try to 
> build the child project, maven tries to download the pom.xml of the parent 
> project but does not replace ${revision}. So maven complains about a missing 
> dependency.



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

Reply via email to