On Mon, May 21, 2012 at 10:58 PM, Brett Porter <br...@apache.org> wrote:
>
> On 22/05/2012, at 12:22 PM, Benson Margulies wrote:
>
>> Brett, I wrote the code today.
>
> I saw that... but didn't you send this afterwards? I thought you were looking 
> for a way to trim it back again to avoid extra maintenance/risk of 
> os-specific bugs.

It went like this:

A few days ago, I started on this, originally thinking it could be
done with URI.relativize. Discovered I was wrong. Then I found the SO
post that you found, and grabbed some code it pointed to, and tried to
clean it up, with poor initial success.

So, I sent out the email in case someone had a magic wand.

Having some time on my hands today and no wand having arrived, I
thought through the problem more carefully, rewrote the code, and
convinced myself that it would cover the plausible use cases. I'm just
not too worried about someone coding some bizarre other-drive-letter
pathname into a POM as the desired location for a dependency-reduced
POM. Checked it all in, ant send out email fishing for testers.




>
>>
>> On May 21, 2012, at 6:51 PM, Brett Porter <br...@apache.org> wrote:
>>
>>> 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
>>>
>>
>> ---------------------------------------------------------------------
>> 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
>

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

Reply via email to