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

Jason Young edited comment on MNG-5889 at 12/21/18 6:57 PM:
------------------------------------------------------------

[~khmarbaise] I have a setup like:

root/pom.xml:
{code}
<groupId>blah</groupId>
<artifactId>root</artifactId>
<version>${revision}</version>
{code}

root/.mvn/maven.config:
{code}
-Drevision=1.2.3
{code}

a/pom.xml
{code}
<parent>
    <groupId>blah</groupId>
    <artifactId>root</artifactId>
</parent>
<artifactId>a</artifactId>
{code}

b/pom.xml
{code}
<parent>
    <groupId>blah</groupId>
    <artifactId>root</artifactId>
</parent>
<artifactId>b</artifactId>
<dependencies>
    <groupId>blah</groupId>
    <artifactId>root</artifactId>
    <version>${project.version}</version>
</dependencies>
{code}

With this setup, `mvn validate` works from the `root/` directory, but `mvn 
--file=root/pom.xml validate` from the parent directory fails. Changing the 
`${project.version}` above to `${revision}` yields the same results. Putting 
the `revision` property in root/pom.xml instead of root/.mvn/maven.config works 
around the problem. Based on these cases, Maven appears to support my use of 
the revision property, but has the same defect as reported in the OP.

Note that I'm using the revision property to set the version of the parent 
project of all other projects, then making some projects depend on others. 
Beyond that, I'm not using the revision property for dependencies. Is my use of 
the revision property supported?


was (Author: [email protected]):
[~khmarbaise] I have a setup like:

root/pom.xml:
```
<groupId>blah</groupId>
<artifactId>root</artifactId>
<version>${revision}</version>
```

root/.mvn/maven.config:
```
-Drevision=1.2.3
```

a/pom.xml
```
<parent>
    <groupId>blah</groupId>
    <artifactId>root</artifactId>
</parent>
<artifactId>a</artifactId>
```

b/pom.xml
```
<parent>
    <groupId>blah</groupId>
    <artifactId>root</artifactId>
</parent>
<artifactId>b</artifactId>
<dependencies>
    <groupId>blah</groupId>
    <artifactId>root</artifactId>
    <version>${project.version}</version>
</dependencies>
```

With this setup, `mvn validate` works from the `root/` directory, but `mvn 
--file=root/pom.xml validate` from the parent directory fails. Changing the 
`${project.version}` above to `${revision}` yields the same results. Putting 
the `revision` property in root/pom.xml instead of root/.mvn/maven.config works 
around the problem. Based on these cases, Maven appears to support my use of 
the revision property, but has the same defect as reported in the OP.

Note that I'm using the revision property to set the version of the parent 
project of all other projects, then making some projects depend on others. 
Beyond that, I'm not using the revision property for dependencies. Is my use of 
the revision property supported?

> .mvn directory should be picked when using --file
> -------------------------------------------------
>
>                 Key: MNG-5889
>                 URL: https://issues.apache.org/jira/browse/MNG-5889
>             Project: Maven
>          Issue Type: Improvement
>          Components: Bootstrap &amp; Build
>    Affects Versions: 3.3.3, 3.3.9
>            Reporter: Daniel Spilker
>            Assignee: Tibor Digana
>            Priority: Major
>             Fix For: 3.5.0-alpha-1, 3.5.0
>
>
> The {{.mvn}} directory is not picked up when using the {{--file}} switch to 
> build a project from outside of the multi-module root.
> Example:
> * the module root is {{/foo/bar}}
> * {{.mvn}} is located at {{/foo/bar/.mvn}}
> * current directory is {{/foo}}
> * Maven is invoked with {{mvn --file bar/module/pom.xml}}
> I would expect the {{.mvn}} directory detection to start at the directory of 
> the POM selected by {{--file}} and then go through the parent directories.



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

Reply via email to