You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Nicolás Lichtmaier <ni...@reloco.com.ar> on 2005/11/12 18:26:00 UTC

[PATCH] mvn can't calculate M2_HOME when mvn is a relative symlink!

 There seems to be a typo in the "mvn" script!

I've reported this in Jira ( http://jira.codehaus.org/browse/MNG-1470 ), 
but nobody seemed to care. I'm now trying to repost the issue here.

Steps to reproduce:

[ untar maven and move it to /usr/local/maven ]
$ cd /usr/local/bin
$ ln -sf ../maven/bin/mvn .
$ mvn
/usr/local/bin/mvn: line 75: cd: ../maven/bin/..: No existe el fichero o 
el directorio
Exception in thread "main" java.lang.NoClassDefFoundError: 
org/codehaus/classworlds/Launcher

It's a very simple fix. When traversing synlinks to get the canonical 
pathname, mvn should treat relative references by appending them to 
"dirname", no the other way around!

A patch is attached.