You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Benson Margulies <bi...@gmail.com> on 2012/05/21 22:42:47 UTC

Shade and the dependency-reduced-pom

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-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: Shade and the dependency-reduced-pom

Posted by Benson Margulies <bi...@gmail.com>.
On Tue, May 22, 2012 at 1:33 AM, Brett Porter <br...@apache.org> wrote:
>
> On 22/05/2012, at 1:35 PM, Benson Margulies wrote:
>
>> 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.
>
> OK... I just read dev@ before commits@ and got the order back to front. Just trying to help :)

Well, of course, since you are upside down. I'm most grateful for your
attention here, really I am.

>
> I'm still wondering where the method I was thinking of is...

Me too.


>
> - Brett
>
> --
> Brett Porter
> brett@apache.org
> http://brettporter.wordpress.com/
> http://au.linkedin.com/in/brettporter
> http://twitter.com/brettporter
>
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>

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


Re: Shade and the dependency-reduced-pom

Posted by Brett Porter <br...@apache.org>.
On 22/05/2012, at 1:35 PM, Benson Margulies wrote:

> 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.

OK... I just read dev@ before commits@ and got the order back to front. Just trying to help :)

I'm still wondering where the method I was thinking of is...

- Brett

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






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


Re: Shade and the dependency-reduced-pom

Posted by Benson Margulies <bi...@gmail.com>.
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-unsubscribe@maven.apache.org
>>>> For additional commands, e-mail: dev-help@maven.apache.org
>>>>
>>>
>>> --
>>> Brett Porter
>>> brett@apache.org
>>> http://brettporter.wordpress.com/
>>> http://au.linkedin.com/in/brettporter
>>> http://twitter.com/brettporter
>>>
>>>
>>>
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>>> For additional commands, e-mail: dev-help@maven.apache.org
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>> For additional commands, e-mail: dev-help@maven.apache.org
>>
>
> --
> Brett Porter
> brett@apache.org
> http://brettporter.wordpress.com/
> http://au.linkedin.com/in/brettporter
> http://twitter.com/brettporter
>
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>

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


Re: Shade and the dependency-reduced-pom

Posted by Brett Porter <br...@apache.org>.
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.

> 
> 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-unsubscribe@maven.apache.org
>>> For additional commands, e-mail: dev-help@maven.apache.org
>>> 
>> 
>> --
>> Brett Porter
>> brett@apache.org
>> http://brettporter.wordpress.com/
>> http://au.linkedin.com/in/brettporter
>> http://twitter.com/brettporter
>> 
>> 
>> 
>> 
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>> For additional commands, e-mail: dev-help@maven.apache.org
>> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
> 

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






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


Re: Shade and the dependency-reduced-pom

Posted by Benson Margulies <bi...@gmail.com>.
Brett, I wrote the code today.

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-unsubscribe@maven.apache.org
>> For additional commands, e-mail: dev-help@maven.apache.org
>>
>
> --
> Brett Porter
> brett@apache.org
> http://brettporter.wordpress.com/
> http://au.linkedin.com/in/brettporter
> http://twitter.com/brettporter
>
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>

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


Re: Shade and the dependency-reduced-pom

Posted by Brett Porter <br...@apache.org>.
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-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
> 

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






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