Hi,

I haven't been itched by such kind of problem, but i'm thinking about a way to make the current implementation better...

Furthermore can we catch such an edge case? I don't know any realiable solution to catch this...

root
 +-- .mvn
 +-- parent/aggregator
 +-- m1
 +-- m2

so this kind can only work correctly with the current implementation if we assume that no other ".mvn" folder does exists an level above "root"...Using my suggestion would fail as well....

The above scenario has also a problem currently cause you need to give -f option like this:

mvn -f parent/pom.xml

which will not work either at the moment as far as i know...(jira exists for that AFAIK)...The question here is: Do we support such "bad practice" (If we see as it)..?

Kind regards
Karl Heinz Marbaise


On 10/13/15 3:21 AM, Jason van Zyl wrote:
There are cases where this would break. It’s not a pattern I see very often but 
when projects put their parent/aggregator pom in a directory of its own there 
is no pom.xml at the upper most level of the project.

I know that Fred got bitten by a .mvn/ directory way up near the root of the 
file system, did you run into a specific problem?

On Oct 12, 2015, at 2:16 PM, Karl Heinz Marbaise <[email protected]> wrote:

Hi,

based on the changes we have made to identify the folder where ".mvn" is 
located i would suggest to enhance the check with checking the pom.xml file as well...So 
i would suggest to enhance the find_maven_basedir() function like the following:

   local basedir="$(pwd)"
   local wdir="$(pwd)"
   while [ "$wdir" != '/' ] ; do
-    if [ -d "$wdir"/.mvn ] ; then
+    if [ -d "$wdir"/.mvn ] && [ -e "$wdir"/pom.xml ] ; then
       basedir=$wdir
       break
     fi

WDYT ?

See also my comments:
[1]: 
https://issues.apache.org/jira/browse/MNG-5858?focusedCommentId=14744204&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-14744204

Kind regards
Karl Heinz Marbaise

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to