http://stackoverflow.com/questions/204784/how-to-construct-a-relative-path-in-java-from-two-absolute-paths-or-urls
http://plexus.codehaus.org/plexus-utils/apidocs/org/codehaus/plexus/util/FileUtils.html#resolveFile(java.io.File,
 java.lang.String)

I was sure there was one around called "relativize", but I can't find it. Maybe 
was thinking of the URI one. I remember dealing with the extensive Windows edge 
cases and so on - probably in Archiva or Wagon/Release/SCM. Your best bet might 
be to use commons-io's normalize on both paths and then chop the common 
path-delimited substring.

I don't suppose you can avoid resolving it though, and just prepend "../" as 
long as you know the depth from the original project, and know that the 
previous value was already relative? Don't forget to cover the Maven 3 case 
where <relativePath></relativePath> turns off the default.

Cheers,
Brett

On 22/05/2012, at 6:42 AM, Benson Margulies wrote:

> MSHADE-115 reports the unpleasant consequences of putting the
> dependency-reduced-pom into the basedir instead of target.
> 
> I'm working on a fix. The fix needs a function that can relativize one
> pathname to another. I'm surprised that there doesn't seem to be one
> of those lying about ... is there one in Plexus that I've perhaps
> missed?
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org
> For additional commands, e-mail: dev-h...@maven.apache.org
> 

--
Brett Porter
br...@apache.org
http://brettporter.wordpress.com/
http://au.linkedin.com/in/brettporter
http://twitter.com/brettporter






---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org
For additional commands, e-mail: dev-h...@maven.apache.org

Reply via email to