You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Christian Gruber <ch...@gmail.com> on 2007/05/25 01:13:06 UTC

thought about a change to compile scope.

Hey.

     I was thinking about the best-practice (I hate that word) of  
including all direct dependencies in a pom even if you would get the  
code transitively (in case transitive relationships are changed  
behind the scenes).  This makes sense, but it makes me wonder if the  
compile phase shouldn't only import dependencies non-transitively.  I  
think that, because the compiler may not need to link in all classes  
ultimately required at runtime, it would effectively enforce this  
best-practice.  Transitivity would be then for runtime scope which is  
obviously used in packaging or deploying.

    One possible problem would be with the m2eclipse plugin which (at  
present) really does need to use transitive dependencies, but I think  
it might actually ignore scope, since eclipse has no such concept and  
I've seen all classes already there (including provided, test, etc.).

    Thoughts? Flaws in thinking?

Christian.


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


Re: thought about a change to compile scope.

Posted by Jason van Zyl <ja...@maven.org>.
On 24 May 07, at 8:00 PM 24 May 07, Brett Porter wrote:

> Not planned to my knowledge. Maven used to do it, and it didn't  
> work because you sometimes need a compile scope dependency  
> transitively (the classic example being extending an abstract class  
> from a different package).
>

It was discussed in conjunction with the problems in hiding p-u where  
tons of plugins picked up compile scope transitively and then were  
crapping out at runtime because it was then hidden. The other  
argument a user made in JIRA was exposing things shouldn't be.

At any rate, nothing will be solved without a specification to look  
at. Central repository switch over is done, a little bit of Taxonomy  
and I'll do some work over the weekend to get 2.1 discussions all  
lined up the artifact resolution spec being one of the most prominent.

> The better solution is to add the ability to export your  
> dependencies in a given scope so that you can hide those considered  
> an implementation detail.
>

Modularity is certainly something we will have to incorporate to mesh  
with Netbeans Modules, OSGi (jsr291) and the upcoming jsr277 in Java 7.

> - Brett
>
> On 25/05/2007, at 9:33 AM, Christian Gruber wrote:
>
>> Nothing like original thought, huh?   :)
>>
>> Never mind then - good to know.  Count this e-mail as a moral +1  
>> on that feature should it ever come to vote.
>>
>> Christian.
>>
>> On May 24, 2007, at 7:29 PM, Brian E. Fox wrote:
>>
>>> I think we have this planned for 2.1. I know it's been discussed  
>>> before.
>>>
>>> -----Original Message-----
>>> From: Christian Gruber [mailto:christianedwardgruber@gmail.com]
>>>
>>> Hey.
>>>
>>>      I was thinking about the best-practice (I hate that word) of
>>> including all direct dependencies in a pom even if you would get the
>>> code transitively (in case transitive relationships are changed
>>> behind the scenes).  This makes sense, but it makes me wonder if the
>>> compile phase shouldn't only import dependencies non-transitively.
>>
>> christian gruber + cgruber@israfil.net + mob 410.900.0796 + mob2  
>> 416.998.6023
>> process coach and architect + ISRÁFÍL CONSULTING SERVICES
>>
>>
>>
>> ---------------------------------------------------------------------
>> 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
>
>

Thanks,

Jason

----------------------------------------------------------
Jason van Zyl
Founder and PMC Chair, Apache Maven
jason at sonatype dot com
----------------------------------------------------------




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


Re: thought about a change to compile scope.

Posted by Christian Gruber <cg...@israfil.net>.
Good point.  The abstract one should be obvious, sorry.  Definitely  
needs a rethink.  Another option would be for putting analysis of the  
actual java classes into the artifact metadata somewhere (not the  
pom, the manifest).   Then you could analyze which artifacts supplied  
which dependant resource.  But that's substantially more complicated  
analysis, and it's hurting my brain, so I'm going to go have food and  
not think about it too hard.

Christian.



On May 24, 2007, at 8:00 PM, Brett Porter wrote:

> Not planned to my knowledge. Maven used to do it, and it didn't  
> work because you sometimes need a compile scope dependency  
> transitively (the classic example being extending an abstract class  
> from a different package).
>
> The better solution is to add the ability to export your  
> dependencies in a given scope so that you can hide those considered  
> an implementation detail.
>
> - Brett
>
> On 25/05/2007, at 9:33 AM, Christian Gruber wrote:
>
>> Nothing like original thought, huh?   :)
>>
>> Never mind then - good to know.  Count this e-mail as a moral +1  
>> on that feature should it ever come to vote.
>>
>> Christian.
>>
>> On May 24, 2007, at 7:29 PM, Brian E. Fox wrote:
>>
>>> I think we have this planned for 2.1. I know it's been discussed  
>>> before.
>>>
>>> -----Original Message-----
>>> From: Christian Gruber [mailto:christianedwardgruber@gmail.com]
>>>
>>> Hey.
>>>
>>>      I was thinking about the best-practice (I hate that word) of
>>> including all direct dependencies in a pom even if you would get the
>>> code transitively (in case transitive relationships are changed
>>> behind the scenes).  This makes sense, but it makes me wonder if the
>>> compile phase shouldn't only import dependencies non-transitively.
>>
>> christian gruber + cgruber@israfil.net + mob 410.900.0796 + mob2  
>> 416.998.6023
>> process coach and architect + ISRÁFÍL CONSULTING SERVICES
>>
>>
>>
>> ---------------------------------------------------------------------
>> 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
>

christian gruber + cgruber@israfil.net + mob 410.900.0796 + mob2  
416.998.6023
process coach and architect + ISRÁFÍL CONSULTING SERVICES



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


Re: thought about a change to compile scope.

Posted by Brett Porter <br...@apache.org>.
Not planned to my knowledge. Maven used to do it, and it didn't work  
because you sometimes need a compile scope dependency transitively  
(the classic example being extending an abstract class from a  
different package).

The better solution is to add the ability to export your dependencies  
in a given scope so that you can hide those considered an  
implementation detail.

- Brett

On 25/05/2007, at 9:33 AM, Christian Gruber wrote:

> Nothing like original thought, huh?   :)
>
> Never mind then - good to know.  Count this e-mail as a moral +1 on  
> that feature should it ever come to vote.
>
> Christian.
>
> On May 24, 2007, at 7:29 PM, Brian E. Fox wrote:
>
>> I think we have this planned for 2.1. I know it's been discussed  
>> before.
>>
>> -----Original Message-----
>> From: Christian Gruber [mailto:christianedwardgruber@gmail.com]
>>
>> Hey.
>>
>>      I was thinking about the best-practice (I hate that word) of
>> including all direct dependencies in a pom even if you would get the
>> code transitively (in case transitive relationships are changed
>> behind the scenes).  This makes sense, but it makes me wonder if the
>> compile phase shouldn't only import dependencies non-transitively.
>
> christian gruber + cgruber@israfil.net + mob 410.900.0796 + mob2  
> 416.998.6023
> process coach and architect + ISRÁFÍL CONSULTING SERVICES
>
>
>
> ---------------------------------------------------------------------
> 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: thought about a change to compile scope.

Posted by Christian Gruber <ch...@gmail.com>.
Nothing like original thought, huh?   :)

Never mind then - good to know.  Count this e-mail as a moral +1 on  
that feature should it ever come to vote.

Christian.

On May 24, 2007, at 7:29 PM, Brian E. Fox wrote:

> I think we have this planned for 2.1. I know it's been discussed  
> before.
>
> -----Original Message-----
> From: Christian Gruber [mailto:christianedwardgruber@gmail.com]
>
> Hey.
>
>      I was thinking about the best-practice (I hate that word) of
> including all direct dependencies in a pom even if you would get the
> code transitively (in case transitive relationships are changed
> behind the scenes).  This makes sense, but it makes me wonder if the
> compile phase shouldn't only import dependencies non-transitively.

christian gruber + cgruber@israfil.net + mob 410.900.0796 + mob2  
416.998.6023
process coach and architect + ISRÁFÍL CONSULTING SERVICES



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


Re: thought about a change to compile scope.

Posted by Mark Hobson <ma...@gmail.com>.
On 25/05/07, Brian E. Fox <br...@reply.infinity.nu> wrote:
> I think we have this planned for 2.1. I know it's been discussed before.

You may be confusing this with a similar issue planned for 2.1:
http://jira.codehaus.org/browse/MNG-2589

I think what Christian is proposing is something akin to Maven 1.

Mark

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


RE: thought about a change to compile scope.

Posted by "Brian E. Fox" <br...@reply.infinity.nu>.
I think we have this planned for 2.1. I know it's been discussed before.

-----Original Message-----
From: Christian Gruber [mailto:christianedwardgruber@gmail.com] 
Sent: Thursday, May 24, 2007 7:13 PM
To: Maven Developers List
Subject: thought about a change to compile scope.

Hey.

     I was thinking about the best-practice (I hate that word) of  
including all direct dependencies in a pom even if you would get the  
code transitively (in case transitive relationships are changed  
behind the scenes).  This makes sense, but it makes me wonder if the  
compile phase shouldn't only import dependencies non-transitively.  I  
think that, because the compiler may not need to link in all classes  
ultimately required at runtime, it would effectively enforce this  
best-practice.  Transitivity would be then for runtime scope which is  
obviously used in packaging or deploying.

    One possible problem would be with the m2eclipse plugin which (at  
present) really does need to use transitive dependencies, but I think  
it might actually ignore scope, since eclipse has no such concept and  
I've seen all classes already there (including provided, test, etc.).

    Thoughts? Flaws in thinking?

Christian.


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