maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stephan Schroevers (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (MNG-5858) mvn script fails to locate .mvn in current directory
Date Mon, 14 Sep 2015 19:26:46 GMT

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

Stephan Schroevers commented on MNG-5858:
-----------------------------------------

[~khmarbaise], you did not misunderstand. :). I definitely agree that {{/.mvn}} doesn't make
sense, but neither do (say) {{/home/.mvn}} and {{/usr/.mvn}}, etc., while the script _would_
use those if present.

Perhaps an argument could be made for {{/.mvn}} in chroot-ed environments, but even that's
a stretch. The only reason I suggest the change is that catering for the edge case doesn't
make the while loop fundamentally more difficult.

Anyway, this topic is too minor to open a discussion about. Happy to see it's fixed for all
cases that are likely to matter!

> mvn script fails to locate .mvn in current directory
> ----------------------------------------------------
>
>                 Key: MNG-5858
>                 URL: https://issues.apache.org/jira/browse/MNG-5858
>             Project: Maven
>          Issue Type: Bug
>    Affects Versions: 3.3.3
>            Reporter: Dave Syer
>            Assignee: Jason van Zyl
>             Fix For: 3.3.7
>
>
> The while loop in the shell script where we look for the .mvn directory is wrong:
> {noformat}
> find_maven_basedir() {
>   local basedir=$(pwd)
>   local wdir=$(pwd)
>   while [ "$wdir" != '/' ] ; do
>     wdir=$(cd "$wdir/.."; pwd)
>     if [ -d "$wdir"/.mvn ] ; then
>       basedir=$wdir
>       break
>     fi
>   done
>   echo "${basedir}"
> }
> {noformat}
> Should be
> {noformat}
> find_maven_basedir() {
>   local basedir=$(pwd)
>   local wdir=$(pwd)
>   while [ "$wdir" != '/' ] ; do
>     if [ -d "$wdir"/.mvn ] ; then
>       basedir=$wdir
>       break
>     fi
>     wdir=$(cd "$wdir/.."; pwd)
>   done
>   echo "${basedir}"
> }
> {noformat}
> That way if the current directory contains .mvn the loop terminates immediately.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message