RE: Dep to same artifact in different versions

2007-05-02 Thread Jörg Schaible
Andrew Williams wrote on Saturday, April 28, 2007 7:06 PM:

> On 26 Apr 2007, at 13:20, Jörg Schaible wrote:
> 
>> Hi Jason,
>> 
>> Therefore the slots. The project itself can introduce them, if two
>> major versions can be used at same time. Think about a hypothetical
>> commons-logging 2.0 (it is discussed) that might have a different
>> API. I am quite sure Jakarta folks will ensure that 2.x and 1.x
>> series can be used at the same time - simply because even in the
>> Maven repo itself ~ 2000 artifacts depend on it. Without something
>> like the slots, you will never be able to create a new Maven-based
>> project using JCL 2.x ...
> 
> Well kick me if I am wrong, but is this not where well managed
> projects use deprecation and wrappers around the new code to work
> from the old API? I know plexus and classworlds are trying to for
> backwards compatibility. 
> 
> What rule states that commons-logging 2.0 cannot contain the
> api from
> commons-logging 1.0 with deprecated marks? I doubt that everytime
> someone wants to change their API they would much rather do
> that than
> make a mutually exclusive, thusly cohabitable, API for the
> new version.

This is a decision of the project and not of Maven. Maven should be able to 
handle the situation though. Additionally your assumption is not valid, since a 
lot of projects maintain a y.x branch (e.g. to provide JDK 1.3 compatibility) 
and (y+1).x head with a cleaned up API and JDK 5 support only. That does not 
mean that the JDK 1.3 branch is obsolete or deprecated nor does it mean that no 
further maintenance releases will be available. Therefore I consider it even a 
bad idea to bundle both versions in the same jar.

- Jörg

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Dep to same artifact in different versions

2007-04-28 Thread Andrew Williams


On 26 Apr 2007, at 13:20, Jörg Schaible wrote:


Hi Jason,

Therefore the slots. The project itself can introduce them, if two  
major versions can be used at same time. Think about a hypothetical  
commons-logging 2.0 (it is discussed) that might have a different  
API. I am quite sure Jakarta folks will ensure that 2.x and 1.x  
series can be used at the same time - simply because even in the  
Maven repo itself ~ 2000 artifacts depend on it. Without something  
like the slots, you will never be able to create a new Maven-based  
project using JCL 2.x ...


Well kick me if I am wrong, but is this not where well managed  
projects use deprecation and wrappers around the new code to work  
from the old API?

I know plexus and classworlds are trying to for backwards compatibility.

What rule states that commons-logging 2.0 cannot contain the api from  
commons-logging 1.0 with deprecated marks? I doubt that everytime  
someone wants to change their API they would much rather do that than  
make a mutually exclusive, thusly cohabitable, API for the new version.


Andy
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Dep to same artifact in different versions

2007-04-26 Thread Jörg Schaible
Jason van Zyl wrote on Thursday, April 26, 2007 4:41 PM:

> On 26 Apr 07, at 10:12 AM 26 Apr 07, Jörg Schaible wrote:
> 
>> Jason van Zyl wrote on Thursday, April 26, 2007 3:21 PM:
>> 
>>> On 26 Apr 07, at 8:20 AM 26 Apr 07, Jörg Schaible wrote:
>> 
>> [snip]
>> 
 Therefore the slots. The project itself can introduce them, if two
 major versions can be used at same time. Think about a hypothetical
 commons-logging 2.0 (it is discussed) that might have a different
 API. I am quite sure Jakarta folks will ensure that 2.x and 1.x
 series can be used at the same time - simply because even in the
 Maven repo itself ~ 2000 artifacts depend on it. Without something
 like the slots, you will never be able to create a new Maven-based
 project using JCL 2.x ...
>>> 
>>> I don't think we need to introduce the idea of slots. Allowing
>>> multiple versions would suffice. I don't see what the slot concept
>>> buys anyone except another term to be familiar with.
>> 
>> Well, so how could this work in practice?
>> 
>> B-2.2 depends on A-1.0.1
>> C-1.3 depends on A-2.1
>> D-1.1 depends on A-1.2
>> E-1.0 depends on C-2.2 and C-1.3

should have been:
E-1.0 depends on B-2.2 and C-1.3

>> F-1.0 depends on E-1.0 and A-1.0.1
>>
>> What do I have to do for E? How does Maven know that A-1.x and
>> A-2.x are both necessary and that it should use A-1.2 and A-2.1? Do
>> I have to add both deps explicitly to E? What does this mean for F?
>> How can I manage in a parent POM the two versions of A in the
>> dependencyManagement? 
> 
> The first question to answer is whether we even want to allow this
> and if the complexity that would arise from situations like this are
> worth it versus having N modules where each module has a different
> set of dependencies. What's easier,  and what's necessary. Because
> there exists a solution in Gentoo for doesn't mean it's necessarily
> the right one for Maven. And because people have these situations in
> their builds also doesn't necessarily mean it's something ideal. Not
> saying it's not worth consideration, just playing the devil's
> advocate. 

I'm quite sure, nobody sets up something like this at free will. Typically A to 
at least D are third party artifacts you don't controll, but you have to manage 
the mess on your end dealing with environments that have themselves no clue 
about isolated classloaders. At this point your level of tolerance for the 
build tool tends to zero. ;-)
 
> In your case here above then in dependency management we would also
> support multiple versions where you could specify defaults, and if
> you needed to override them in the child you would. This translates
> into multiple version support all the way down in the core.

>From my naive PoV, it looked easier to introduce a "slot" that behaves quite 
>like a classifier than implementing support for multiple versions at once. 
>*This* would have scared me much more. However, you're the expert with best 
>knowledge of the internals and you can estimate the impact much better than me.

[snip]

> Yes, as I said this doesn't necessarily translate into an ideal for
> Maven. My default position now is the distro tools take their notions
> and wind them all the way down into the core of the distro which
> doesn't necessarily jive well with Maven. Again I'm not dismissing
> slots and multiple versions allowable in the POM.

I'm quite sure, the topic will rise again. Better to be prepared about the 
options, especially since M2.1 is not that far away. Anyway, thanks for your 
time.

- Jörg

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Dep to same artifact in different versions

2007-04-26 Thread Jason van Zyl


On 26 Apr 07, at 10:12 AM 26 Apr 07, Jörg Schaible wrote:


Jason van Zyl wrote on Thursday, April 26, 2007 3:21 PM:


On 26 Apr 07, at 8:20 AM 26 Apr 07, Jörg Schaible wrote:


[snip]


Therefore the slots. The project itself can introduce them, if two
major versions can be used at same time. Think about a hypothetical
commons-logging 2.0 (it is discussed) that might have a different
API. I am quite sure Jakarta folks will ensure that 2.x and 1.x
series can be used at the same time - simply because even in the
Maven repo itself ~ 2000 artifacts depend on it. Without something
like the slots, you will never be able to create a new Maven-based
project using JCL 2.x ...


I don't think we need to introduce the idea of slots. Allowing
multiple versions would suffice. I don't see what the slot concept
buys anyone except another term to be familiar with.


Well, so how could this work in practice?

B-2.2 depends on A-1.0.1
C-1.3 depends on A-2.1
D-1.1 depends on A-1.2
E-1.0 depends on C-2.2 and C-1.3
F-1.0 depends on E-1.0 and A-1.0.1

What do I have to do for E? How does Maven know that A-1.x and  
A-2.x are both necessary and that it should use A-1.2 and A-2.1? Do  
I have to add both deps explicitly to E? What does this mean for F?  
How can I manage in a parent POM the two versions of A in the  
dependencyManagement?




The first question to answer is whether we even want to allow this  
and if the complexity that would arise from situations like this are  
worth it versus having N modules where each module has a different  
set of dependencies. What's easier,  and what's necessary. Because  
there exists a solution in Gentoo for doesn't mean it's necessarily  
the right one for Maven. And because people have these situations in  
their builds also doesn't necessarily mean it's something ideal. Not  
saying it's not worth consideration, just playing the devil's advocate.


In your case here above then in dependency management we would also  
support multiple versions where you could specify defaults, and if  
you needed to override them in the child you would. This translates  
into multiple version support all the way down in the core.



[snip]


If your project cannot define the deps directly, the module
approach does not work. See the JCL example.


Yes, it works if they are separate modules. But as I said
above it is
not a technical problem to allow multiple versions of JMock for
example. At first blush I just see this causing more problems then
viable solutions.


Well, therefore I refered Gentoo in my first post. They already  
have been there and found a solution.




Yes, as I said this doesn't necessarily translate into an ideal for  
Maven. My default position now is the distro tools take their notions  
and wind them all the way down into the core of the distro which  
doesn't necessarily jive well with Maven. Again I'm not dismissing  
slots and multiple versions allowable in the POM.


Jason.


- Jörg

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Dep to same artifact in different versions

2007-04-26 Thread Jörg Schaible
Jason van Zyl wrote on Thursday, April 26, 2007 3:21 PM:

> On 26 Apr 07, at 8:20 AM 26 Apr 07, Jörg Schaible wrote:

[snip]

>> Therefore the slots. The project itself can introduce them, if two
>> major versions can be used at same time. Think about a hypothetical
>> commons-logging 2.0 (it is discussed) that might have a different
>> API. I am quite sure Jakarta folks will ensure that 2.x and 1.x
>> series can be used at the same time - simply because even in the
>> Maven repo itself ~ 2000 artifacts depend on it. Without something
>> like the slots, you will never be able to create a new Maven-based
>> project using JCL 2.x ...
> 
> I don't think we need to introduce the idea of slots. Allowing
> multiple versions would suffice. I don't see what the slot concept
> buys anyone except another term to be familiar with.

Well, so how could this work in practice?

B-2.2 depends on A-1.0.1
C-1.3 depends on A-2.1
D-1.1 depends on A-1.2
E-1.0 depends on C-2.2 and C-1.3
F-1.0 depends on E-1.0 and A-1.0.1

What do I have to do for E? How does Maven know that A-1.x and A-2.x are both 
necessary and that it should use A-1.2 and A-2.1? Do I have to add both deps 
explicitly to E? What does this mean for F? How can I manage in a parent POM 
the two versions of A in the dependencyManagement?

[snip]

>> If your project cannot define the deps directly, the module
>> approach does not work. See the JCL example.
> 
> Yes, it works if they are separate modules. But as I said
> above it is
> not a technical problem to allow multiple versions of JMock for
> example. At first blush I just see this causing more problems then
> viable solutions. 

Well, therefore I refered Gentoo in my first post. They already have been there 
and found a solution.

- Jörg

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Dep to same artifact in different versions

2007-04-26 Thread Jason van Zyl


On 26 Apr 07, at 8:20 AM 26 Apr 07, Jörg Schaible wrote:


Hi Jason,

Jason van Zyl wrote on Thursday, April 26, 2007 1:52 PM:


On 26 Apr 07, at 6:05 AM 26 Apr 07, Arik Kfir wrote:

IMO, if the project claims to be backwards-compatible, then it  
should

include the older classes. If they can exist side-by-side, there
should be no issue.



I don't think you can force every project to do this, and I think
that users would intuitively users expect that two versions of, say,
junit that are declared should show up. So what Jorg is
asking for is
not unreasonable and I'm really just trying to think of the
repercussions of allowing multiple versions i.e. do we have any
plugins keying off special versions of classes: the surefire plugin
for example. I think the JMock example is perfectly valid and is
something that could be addressed in 2.1 but here is my concern and
generally why we took the strategy of not allowing this to begin  
with:


The classpath order is now derived from the order of the listing of
the dependencies. So in a particular project what if one case
requires class C1 from version 1.0 of JMock, and another case that
requires class C1 from version 2.0 of JMock? How are you going to
satisfy those two conditions and in general how are you going to
protect against classes that have the same name in different
versions
of the JAR where both are needed?. When this case arises you are
going to need a form of paritioning, yes?


Well, Nat *is* a bright guy :) Although both versions share the  
same root package, they have no overlap in claases itself. It is  
the perfect case for a "slotted" artifact - both development  
branches can be used at same time. And they continue development in  
both.




They don't have to be slotted. Maven does not prevent you from using  
multiple versions on a system, which is what the slotting approach is  
for. It's only for a project, and it's technically not hard to admit  
multiple versions into the processing. This is not a technical problem.



Because you're
going to end
up requiring features from the new version which means using the
newer classes. If you are going to need some way to say "for this
group of tests use this version of JMock" and "for this other set of
tests use that version of JMock" then you've gotten yourself into a
case that cannot be satisfied easy.

If projects could guaranteed that version N and the next major
upgrade guaranteed compatibility of the intersection of classes in
the different versions and additions were a superset of that then
adding both versions would be fine. But this is often not the case
and you get into real problems because the general rule for major
version number changes is that the API can break which means that a
class in 2.0 could be significantly different in API and structure
then its equivalent in 1.0.


If the project does not play nice, Maven cannot help you. Look at  
the ASM nightmare. Plain CGLIB 2.x depends on ASM 1.x while popular  
packages like Hibernate-3 or Groovy use ASM 2.x. Unfortunately both  
ASM versions are not compatible and either you break the artifacts  
depending on CGLIB or the other ones. CGLIB solved this by the - 
nodep artifact that contains the necessary ASM 1.x classes with a  
different package name, but, alas, this is also quite a hack.  
However, this mess was caused by the ASM project team itself.


I don't think the uber JAR approach works as well as child first  
loading classloaders so that you can use multiple versions of a  
library. Much like a webapp where two webapps could easily use  
different versions of CGLIB. But I think the  uber JAR approach where  
a transitive hull is used to reduce the payload and then mange non- 
public interfaces is a fine approach.





In Ant you might create a separate classpath with different JARs and
apply that to a different set of classes. We avoid this by simply
saying, this is just too complicated and take your tests, create
another module that uses the new version of JMock and be done with  
it.


What is easier: creating a separate module which has this
simple rule
of allowing only one version of a dependency and using all the same
patterns of every other type of Maven module. Or allow multiple
versions and then start trying to rig up ways to defend against
incompatibilities and partitioning sets of classes for use with a
particular dependency? I think just making another module is easier.


Therefore the slots. The project itself can introduce them, if two  
major versions can be used at same time. Think about a hypothetical  
commons-logging 2.0 (it is discussed) that might have a different  
API. I am quite sure Jakarta folks will ensure that 2.x and 1.x  
series can be used at the same time - simply because even in the  
Maven repo itself ~ 2000 artifacts depend on it. Without something  
like the slots, you will never be able to create a new Maven-based  
project using JCL 2.x ...


I don't think we need to introduce the idea 

RE: Dep to same artifact in different versions

2007-04-26 Thread Brian E. Fox
Couldn't you just use shade and/or uber jar to combine into a new one and 
depend on that? 

-Original Message-
From: Jason van Zyl [mailto:[EMAIL PROTECTED] 
Sent: Thursday, April 26, 2007 7:52 AM
To: Maven Developers List
Subject: Re: Dep to same artifact in different versions


On 26 Apr 07, at 6:05 AM 26 Apr 07, Arik Kfir wrote:

> IMO, if the project claims to be backwards-compatible, then it should
> include the older classes. If they can exist side-by-side, there  
> should be
> no issue.
>

I don't think you can force every project to do this, and I think  
that users would intuitively users expect that two versions of, say,  
junit that are declared should show up. So what Jorg is asking for is  
not unreasonable and I'm really just trying to think of the  
repercussions of allowing multiple versions i.e. do we have any  
plugins keying off special versions of classes: the surefire plugin  
for example. I think the JMock example is perfectly valid and is  
something that could be addressed in 2.1 but here is my concern and  
generally why we took the strategy of not allowing this to begin with:

The classpath order is now derived from the order of the listing of  
the dependencies. So in a particular project what if one case  
requires class C1 from version 1.0 of JMock, and another case that  
requires class C1 from version 2.0 of JMock? How are you going to  
satisfy those two conditions and in general how are you going to  
protect against classes that have the same name in different versions  
of the JAR where both are needed?. When this case arises you are  
going to need a form of paritioning, yes? Because you're going to end  
up requiring features from the new version which means using the  
newer classes. If you are going to need some way to say "for this  
group of tests use this version of JMock" and "for this other set of  
tests use that version of JMock" then you've gotten yourself into a  
case that cannot be satisfied easy.

If projects could guaranteed that version N and the next major  
upgrade guaranteed compatibility of the intersection of classes in  
the different versions and additions were a superset of that then  
adding both versions would be fine. But this is often not the case  
and you get into real problems because the general rule for major  
version number changes is that the API can break which means that a  
class in 2.0 could be significantly different in API and structure  
then its equivalent in 1.0.

In Ant you might create a separate classpath with different JARs and  
apply that to a different set of classes. We avoid this by simply  
saying, this is just too complicated and take your tests, create  
another module that uses the new version of JMock and be done with it.

What is easier: creating a separate module which has this simple rule  
of allowing only one version of a dependency and using all the same  
patterns of every other type of Maven module. Or allow multiple  
versions and then start trying to rig up ways to defend against  
incompatibilities and partitioning sets of classes for use with a  
particular dependency? I think just making another module is easier.

Are you sure you can defend against and cope with the two versions of  
JMock without any problem? Nat is a bright guy, and is probably very  
careful about changes between versions but lots of project are not  
and we decided not to allow multiple versions to protect people from  
less then stringent practices that generally happen in real life.

We tried to make the rules for a single module simple, and make it  
simple to create new one. It's just so much easier for the rest of  
the tool chain to understand then trying to deal with the innumerable  
variations that occurs when multiple anything is allowed: multiple  
versions, multiple source trees, and multiple artifacts per unit of  
work which is a POM/module in Maven.

That's the not so short answer, but the reason why we do what we do.  
I know what users expect to happen, but try to think of the counter  
examples where things might go wrong by using multiple versions in  
the same module.

Jason.

> I see your point, though - I just don't think it is methodology- 
> correct to
> use different versions of the same project in one place, regardless  
> of the
> saying that "it works", because it just doesn't seem "right" to me...
>
> anyway - just my 2 cents; I have no real objection for Maven to  
> support
> declaring two dependencies of the same artifact with different  
> version.
>
> cheers,
>  Arik.
>
> On 4/26/07, Jörg Schaible <[EMAIL PROTECTED]> wrote:
>>
>> Grzegorz Slowikowski wrote on Thursday, April 26, 2007 10:47 AM:
>>
>> > Hi
>> >
>> > Look at hibernate2 and hibernate3 artifacts. They have  
>> "hib

RE: Dep to same artifact in different versions

2007-04-26 Thread Jörg Schaible
Hi Jason,

Jason van Zyl wrote on Thursday, April 26, 2007 1:52 PM:

> On 26 Apr 07, at 6:05 AM 26 Apr 07, Arik Kfir wrote:
> 
>> IMO, if the project claims to be backwards-compatible, then it should
>> include the older classes. If they can exist side-by-side, there
>> should be no issue.
>> 
> 
> I don't think you can force every project to do this, and I think
> that users would intuitively users expect that two versions of, say,
> junit that are declared should show up. So what Jorg is
> asking for is
> not unreasonable and I'm really just trying to think of the
> repercussions of allowing multiple versions i.e. do we have any
> plugins keying off special versions of classes: the surefire plugin
> for example. I think the JMock example is perfectly valid and is
> something that could be addressed in 2.1 but here is my concern and
> generally why we took the strategy of not allowing this to begin with:
> 
> The classpath order is now derived from the order of the listing of
> the dependencies. So in a particular project what if one case
> requires class C1 from version 1.0 of JMock, and another case that
> requires class C1 from version 2.0 of JMock? How are you going to
> satisfy those two conditions and in general how are you going to
> protect against classes that have the same name in different
> versions
> of the JAR where both are needed?. When this case arises you are
> going to need a form of paritioning, yes?

Well, Nat *is* a bright guy :) Although both versions share the same root 
package, they have no overlap in claases itself. It is the perfect case for a 
"slotted" artifact - both development branches can be used at same time. And 
they continue development in both.

> Because you're
> going to end
> up requiring features from the new version which means using the
> newer classes. If you are going to need some way to say "for this
> group of tests use this version of JMock" and "for this other set of
> tests use that version of JMock" then you've gotten yourself into a
> case that cannot be satisfied easy.
> 
> If projects could guaranteed that version N and the next major
> upgrade guaranteed compatibility of the intersection of classes in
> the different versions and additions were a superset of that then
> adding both versions would be fine. But this is often not the case
> and you get into real problems because the general rule for major
> version number changes is that the API can break which means that a
> class in 2.0 could be significantly different in API and structure
> then its equivalent in 1.0. 

If the project does not play nice, Maven cannot help you. Look at the ASM 
nightmare. Plain CGLIB 2.x depends on ASM 1.x while popular packages like 
Hibernate-3 or Groovy use ASM 2.x. Unfortunately both ASM versions are not 
compatible and either you break the artifacts depending on CGLIB or the other 
ones. CGLIB solved this by the -nodep artifact that contains the necessary ASM 
1.x classes with a different package name, but, alas, this is also quite a 
hack. However, this mess was caused by the ASM project team itself.
 
> In Ant you might create a separate classpath with different JARs and
> apply that to a different set of classes. We avoid this by simply
> saying, this is just too complicated and take your tests, create
> another module that uses the new version of JMock and be done with it.
> 
> What is easier: creating a separate module which has this
> simple rule
> of allowing only one version of a dependency and using all the same
> patterns of every other type of Maven module. Or allow multiple
> versions and then start trying to rig up ways to defend against
> incompatibilities and partitioning sets of classes for use with a
> particular dependency? I think just making another module is easier.

Therefore the slots. The project itself can introduce them, if two major 
versions can be used at same time. Think about a hypothetical commons-logging 
2.0 (it is discussed) that might have a different API. I am quite sure Jakarta 
folks will ensure that 2.x and 1.x series can be used at the same time - simply 
because even in the Maven repo itself ~ 2000 artifacts depend on it. Without 
something like the slots, you will never be able to create a new Maven-based 
project using JCL 2.x ...
 
> Are you sure you can defend against and cope with the two
> versions of
> JMock without any problem? Nat is a bright guy, and is probably very
> careful about changes between versions but lots of project are not
> and we decided not to allow multiple versions to protect people from
> less then stringent practices that generally happen in real life.

Yep.
 
> We tried to make the rules for a single module simple, and make it
> simple to create new one. It's just so much easier for the rest of
> the tool chain to understand then trying to deal with the
> innumerable
> variations that occurs when multiple anything is allowed: multiple
> versions, multiple source trees, and multiple artifacts

Re: Dep to same artifact in different versions

2007-04-26 Thread Jason van Zyl


On 26 Apr 07, at 6:05 AM 26 Apr 07, Arik Kfir wrote:


IMO, if the project claims to be backwards-compatible, then it should
include the older classes. If they can exist side-by-side, there  
should be

no issue.



I don't think you can force every project to do this, and I think  
that users would intuitively users expect that two versions of, say,  
junit that are declared should show up. So what Jorg is asking for is  
not unreasonable and I'm really just trying to think of the  
repercussions of allowing multiple versions i.e. do we have any  
plugins keying off special versions of classes: the surefire plugin  
for example. I think the JMock example is perfectly valid and is  
something that could be addressed in 2.1 but here is my concern and  
generally why we took the strategy of not allowing this to begin with:


The classpath order is now derived from the order of the listing of  
the dependencies. So in a particular project what if one case  
requires class C1 from version 1.0 of JMock, and another case that  
requires class C1 from version 2.0 of JMock? How are you going to  
satisfy those two conditions and in general how are you going to  
protect against classes that have the same name in different versions  
of the JAR where both are needed?. When this case arises you are  
going to need a form of paritioning, yes? Because you're going to end  
up requiring features from the new version which means using the  
newer classes. If you are going to need some way to say "for this  
group of tests use this version of JMock" and "for this other set of  
tests use that version of JMock" then you've gotten yourself into a  
case that cannot be satisfied easy.


If projects could guaranteed that version N and the next major  
upgrade guaranteed compatibility of the intersection of classes in  
the different versions and additions were a superset of that then  
adding both versions would be fine. But this is often not the case  
and you get into real problems because the general rule for major  
version number changes is that the API can break which means that a  
class in 2.0 could be significantly different in API and structure  
then its equivalent in 1.0.


In Ant you might create a separate classpath with different JARs and  
apply that to a different set of classes. We avoid this by simply  
saying, this is just too complicated and take your tests, create  
another module that uses the new version of JMock and be done with it.


What is easier: creating a separate module which has this simple rule  
of allowing only one version of a dependency and using all the same  
patterns of every other type of Maven module. Or allow multiple  
versions and then start trying to rig up ways to defend against  
incompatibilities and partitioning sets of classes for use with a  
particular dependency? I think just making another module is easier.


Are you sure you can defend against and cope with the two versions of  
JMock without any problem? Nat is a bright guy, and is probably very  
careful about changes between versions but lots of project are not  
and we decided not to allow multiple versions to protect people from  
less then stringent practices that generally happen in real life.


We tried to make the rules for a single module simple, and make it  
simple to create new one. It's just so much easier for the rest of  
the tool chain to understand then trying to deal with the innumerable  
variations that occurs when multiple anything is allowed: multiple  
versions, multiple source trees, and multiple artifacts per unit of  
work which is a POM/module in Maven.


That's the not so short answer, but the reason why we do what we do.  
I know what users expect to happen, but try to think of the counter  
examples where things might go wrong by using multiple versions in  
the same module.


Jason.

I see your point, though - I just don't think it is methodology- 
correct to
use different versions of the same project in one place, regardless  
of the

saying that "it works", because it just doesn't seem "right" to me...

anyway - just my 2 cents; I have no real objection for Maven to  
support
declaring two dependencies of the same artifact with different  
version.


cheers,
 Arik.

On 4/26/07, Jörg Schaible <[EMAIL PROTECTED]> wrote:


Grzegorz Slowikowski wrote on Thursday, April 26, 2007 10:47 AM:

> Hi
>
> Look at hibernate2 and hibernate3 artifacts. They have  
"hibernate" and

> "org.hibernate"
> groupIds respectively, so they can be used together (java package
> names are different too).
> This is IMO the proper way to do this.
>
> While writing this mail I found:
> http://jira.codehaus.org/browse/MAVENUPLOAD-1500#action_94054
>
> which confirms what I have written above.

You simply acknowledge that the problem exists! The fact that  
jMock will

now switch groupId form jmock to org.jmock is exactly driven by this
limitation. The first question I received from Nat of jMock was:  
"And what
wi

Re: Dep to same artifact in different versions

2007-04-26 Thread Arik Kfir

IMO, if the project claims to be backwards-compatible, then it should
include the older classes. If they can exist side-by-side, there should be
no issue.

I see your point, though - I just don't think it is methodology-correct to
use different versions of the same project in one place, regardless of the
saying that "it works", because it just doesn't seem "right" to me...

anyway - just my 2 cents; I have no real objection for Maven to support
declaring two dependencies of the same artifact with different version.

cheers,
 Arik.

On 4/26/07, Jörg Schaible <[EMAIL PROTECTED]> wrote:


Grzegorz Slowikowski wrote on Thursday, April 26, 2007 10:47 AM:

> Hi
>
> Look at hibernate2 and hibernate3 artifacts. They have "hibernate" and
> "org.hibernate"
> groupIds respectively, so they can be used together (java package
> names are different too).
> This is IMO the proper way to do this.
>
> While writing this mail I found:
> http://jira.codehaus.org/browse/MAVENUPLOAD-1500#action_94054
>
> which confirms what I have written above.

You simply acknowledge that the problem exists! The fact that jMock will
now switch groupId form jmock to org.jmock is exactly driven by this
limitation. The first question I received from Nat of jMock was: "And what
will happoen next time?". And I would rather think about the consequences
regarding M2.1 now instead of putting my head into the sand.

- Jörg

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: Dep to same artifact in different versions

2007-04-26 Thread Jörg Schaible
Grzegorz Slowikowski wrote on Thursday, April 26, 2007 10:47 AM:

> Hi
> 
> Look at hibernate2 and hibernate3 artifacts. They have "hibernate" and
> "org.hibernate"
> groupIds respectively, so they can be used together (java package
> names are different too).
> This is IMO the proper way to do this.
> 
> While writing this mail I found:
> http://jira.codehaus.org/browse/MAVENUPLOAD-1500#action_94054
> 
> which confirms what I have written above.

You simply acknowledge that the problem exists! The fact that jMock will now 
switch groupId form jmock to org.jmock is exactly driven by this limitation. 
The first question I received from Nat of jMock was: "And what will happoen 
next time?". And I would rather think about the consequences regarding M2.1 now 
instead of putting my head into the sand.

- Jörg

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Dep to same artifact in different versions

2007-04-26 Thread Grzegorz Słowikowski

Hi

Look at hibernate2 and hibernate3 artifacts. They have "hibernate" and 
"org.hibernate"
groupIds respectively, so they can be used together (java package names 
are different too).

This is IMO the proper way to do this.

While writing this mail I found:
http://jira.codehaus.org/browse/MAVENUPLOAD-1500#action_94054

which confirms what I have written above.

Greetings

Grzegorz Slowikowski


Arik Kfir napisał(a):

Doesn't the jmock2 contains the classes of jmock1 as well?

On 4/25/07, Jörg Schaible <[EMAIL PROTECTED]> wrote:


Jason van Zyl wrote on Wednesday, April 25, 2007 3:26 PM:

> On 25 Apr 07, at 9:00 AM 25 Apr 07, Jörg Schaible wrote:
>
>> Jason van Zyl wrote on Wednesday, April 25, 2007 2:41 PM:
>>
>>> On 25 Apr 07, at 8:09 AM 25 Apr 07, Jörg Schaible wrote:
>>>
 Hi devs,

 how will Maven handle the problem of a dependency that should be
 used in two different versions? This applies to all project that
 release a new (normally major) version that can be used with the
 old version at the same time. This is currently possible at least
 with:

 jmock 1.x / jmock 2.x
 webworks 1.x / webworks 2.x

 Maven supprts currently only two "versions" of sa dep if
 "groupId:artifactId" is different between those two versions/
 branches, but this might not be always the case. In Gentoo Linux
 such a situation is solved by introducing a "slot" indicating two
 different development trees that can be installed at the same time.
 For Maven this would mean that the separation between (main)
 artifacts should switch to "groupId:artifactId:slot", where slot
 is 0 by default

 Is there already a proposal or doc for such kind of functionality
 in a future release that I might have been missed?

>>>
>>> Sorry, I'm not sure I fully understand what you're talking about. If
>>> you want a specific version of something why would we use a slot,
>>> when you can specify the version? If you want to use Webwork
>>> 1.x then
>>> you specify the version. Many versions sit happily together in the
>>> repository. Or are you talking about behavior that should be
>>> constricted to a certain version range? For example, in
>>> selecting the
>>> latest version of the 1.x family?
>>>
>>> I'm honestly not sure what you're talking about. Maybe a problem
>>> trying to translate Gentoo speak to Maven?
>>
>> Maven speek:
>>
>> 
>>   
>> jmock
>> jmock
>> 1.2.0
>>   
>>   
>> jmock
>> jmock
>> 2.0.0
>>   
>> 
>>
>> jMock 2.x is designed to be used at the same time as jMock 1.x. My
>> code uses both. So how can I define the deps?
>>
>
> First I'll ask why you are using both versions in one project and
> then I'll answer your question.

Becasue I have 1000 of old unit tests with jMock 1.x, I am switching my
project to JDK 5 and write my new unit tests with improved DSL and
annotation support of jMock 2.x. No need at all to to convert the 
1000 old
tests (some might be converted over time). This is exaclty why jMock 
1.xand jMock

2.x is designed to be used at the same time.

- Jörg

BTW: The same problem appears if your deps depend transitively on two
development branches of the same artifact, that are classloader 
compatible

(different class names) and might be used at the same time.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Dep to same artifact in different versions

2007-04-25 Thread Jörg Schaible
Arik Kfir wrote on Wednesday, April 25, 2007 4:15 PM:

> Doesn't the jmock2 contains the classes of jmock1 as well?

No. They should be used side-by-side.

And this is a general problem. No project will change their domain/packages and 
adjust artifact names, simply because Maven cannot handle the situation. The 
problem has been delayed, since a lot of projects used the transition from M1 
to M2 also to adjust their groupId according their domain, but this does 
obviously not scale.

- Jörg

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Dep to same artifact in different versions

2007-04-25 Thread Arik Kfir

Doesn't the jmock2 contains the classes of jmock1 as well?

On 4/25/07, Jörg Schaible <[EMAIL PROTECTED]> wrote:


Jason van Zyl wrote on Wednesday, April 25, 2007 3:26 PM:

> On 25 Apr 07, at 9:00 AM 25 Apr 07, Jörg Schaible wrote:
>
>> Jason van Zyl wrote on Wednesday, April 25, 2007 2:41 PM:
>>
>>> On 25 Apr 07, at 8:09 AM 25 Apr 07, Jörg Schaible wrote:
>>>
 Hi devs,

 how will Maven handle the problem of a dependency that should be
 used in two different versions? This applies to all project that
 release a new (normally major) version that can be used with the
 old version at the same time. This is currently possible at least
 with:

 jmock 1.x / jmock 2.x
 webworks 1.x / webworks 2.x

 Maven supprts currently only two "versions" of sa dep if
 "groupId:artifactId" is different between those two versions/
 branches, but this might not be always the case. In Gentoo Linux
 such a situation is solved by introducing a "slot" indicating two
 different development trees that can be installed at the same time.
 For Maven this would mean that the separation between (main)
 artifacts should switch to "groupId:artifactId:slot", where slot
 is 0 by default

 Is there already a proposal or doc for such kind of functionality
 in a future release that I might have been missed?

>>>
>>> Sorry, I'm not sure I fully understand what you're talking about. If
>>> you want a specific version of something why would we use a slot,
>>> when you can specify the version? If you want to use Webwork
>>> 1.x then
>>> you specify the version. Many versions sit happily together in the
>>> repository. Or are you talking about behavior that should be
>>> constricted to a certain version range? For example, in
>>> selecting the
>>> latest version of the 1.x family?
>>>
>>> I'm honestly not sure what you're talking about. Maybe a problem
>>> trying to translate Gentoo speak to Maven?
>>
>> Maven speek:
>>
>> 
>>   
>> jmock
>> jmock
>> 1.2.0
>>   
>>   
>> jmock
>> jmock
>> 2.0.0
>>   
>> 
>>
>> jMock 2.x is designed to be used at the same time as jMock 1.x. My
>> code uses both. So how can I define the deps?
>>
>
> First I'll ask why you are using both versions in one project and
> then I'll answer your question.

Becasue I have 1000 of old unit tests with jMock 1.x, I am switching my
project to JDK 5 and write my new unit tests with improved DSL and
annotation support of jMock 2.x. No need at all to to convert the 1000 old
tests (some might be converted over time). This is exaclty why jMock 1.xand 
jMock
2.x is designed to be used at the same time.

- Jörg

BTW: The same problem appears if your deps depend transitively on two
development branches of the same artifact, that are classloader compatible
(different class names) and might be used at the same time.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: Dep to same artifact in different versions

2007-04-25 Thread Jörg Schaible
Jason van Zyl wrote on Wednesday, April 25, 2007 3:26 PM:

> On 25 Apr 07, at 9:00 AM 25 Apr 07, Jörg Schaible wrote:
> 
>> Jason van Zyl wrote on Wednesday, April 25, 2007 2:41 PM:
>> 
>>> On 25 Apr 07, at 8:09 AM 25 Apr 07, Jörg Schaible wrote:
>>> 
 Hi devs,
 
 how will Maven handle the problem of a dependency that should be
 used in two different versions? This applies to all project that
 release a new (normally major) version that can be used with the
 old version at the same time. This is currently possible at least
 with: 
 
 jmock 1.x / jmock 2.x
 webworks 1.x / webworks 2.x
 
 Maven supprts currently only two "versions" of sa dep if
 "groupId:artifactId" is different between those two versions/
 branches, but this might not be always the case. In Gentoo Linux
 such a situation is solved by introducing a "slot" indicating two
 different development trees that can be installed at the same time.
 For Maven this would mean that the separation between (main)
 artifacts should switch to "groupId:artifactId:slot", where slot
 is 0 by default 
 
 Is there already a proposal or doc for such kind of functionality
 in a future release that I might have been missed?
 
>>> 
>>> Sorry, I'm not sure I fully understand what you're talking about. If
>>> you want a specific version of something why would we use a slot,
>>> when you can specify the version? If you want to use Webwork
>>> 1.x then
>>> you specify the version. Many versions sit happily together in the
>>> repository. Or are you talking about behavior that should be
>>> constricted to a certain version range? For example, in
>>> selecting the
>>> latest version of the 1.x family?
>>> 
>>> I'm honestly not sure what you're talking about. Maybe a problem
>>> trying to translate Gentoo speak to Maven?
>> 
>> Maven speek:
>> 
>> 
>>   
>> jmock
>> jmock
>> 1.2.0
>>   
>>   
>> jmock
>> jmock
>> 2.0.0
>>   
>> 
>> 
>> jMock 2.x is designed to be used at the same time as jMock 1.x. My
>> code uses both. So how can I define the deps?
>> 
> 
> First I'll ask why you are using both versions in one project and
> then I'll answer your question.

Becasue I have 1000 of old unit tests with jMock 1.x, I am switching my project 
to JDK 5 and write my new unit tests with improved DSL and annotation support 
of jMock 2.x. No need at all to to convert the 1000 old tests (some might be 
converted over time). This is exaclty why jMock 1.x and jMock 2.x is designed 
to be used at the same time.

- Jörg

BTW: The same problem appears if your deps depend transitively on two 
development branches of the same artifact, that are classloader compatible 
(different class names) and might be used at the same time.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Dep to same artifact in different versions

2007-04-25 Thread Jason van Zyl


On 25 Apr 07, at 9:00 AM 25 Apr 07, Jörg Schaible wrote:


Jason van Zyl wrote on Wednesday, April 25, 2007 2:41 PM:


On 25 Apr 07, at 8:09 AM 25 Apr 07, Jörg Schaible wrote:


Hi devs,

how will Maven handle the problem of a dependency that should be
used in two different versions? This applies to all project that
release a new (normally major) version that can be used with the
old version at the same time. This is currently possible at least
with:

jmock 1.x / jmock 2.x
webworks 1.x / webworks 2.x

Maven supprts currently only two "versions" of sa dep if
"groupId:artifactId" is different between those two versions/
branches, but this might not be always the case. In Gentoo Linux
such a situation is solved by introducing a "slot" indicating two
different development trees that can be installed at the same time.
For Maven this would mean that the separation between (main)
artifacts should switch to "groupId:artifactId:slot", where slot is
0 by default

Is there already a proposal or doc for such kind of functionality
in a future release that I might have been missed?



Sorry, I'm not sure I fully understand what you're talking about. If
you want a specific version of something why would we use a slot,
when you can specify the version? If you want to use Webwork
1.x then
you specify the version. Many versions sit happily together in the
repository. Or are you talking about behavior that should be
constricted to a certain version range? For example, in
selecting the
latest version of the 1.x family?

I'm honestly not sure what you're talking about. Maybe a problem
trying to translate Gentoo speak to Maven?


Maven speek:


  
jmock
jmock
1.2.0
  
  
jmock
jmock
2.0.0
  


jMock 2.x is designed to be used at the same time as jMock 1.x. My  
code uses both. So how can I define the deps?




First I'll ask why you are using both versions in one project and  
then I'll answer your question.


Jason.


- Jörg

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Dep to same artifact in different versions

2007-04-25 Thread Jörg Schaible
Jason van Zyl wrote on Wednesday, April 25, 2007 2:41 PM:

> On 25 Apr 07, at 8:09 AM 25 Apr 07, Jörg Schaible wrote:
> 
>> Hi devs,
>> 
>> how will Maven handle the problem of a dependency that should be
>> used in two different versions? This applies to all project that
>> release a new (normally major) version that can be used with the
>> old version at the same time. This is currently possible at least
>> with: 
>> 
>> jmock 1.x / jmock 2.x
>> webworks 1.x / webworks 2.x
>> 
>> Maven supprts currently only two "versions" of sa dep if
>> "groupId:artifactId" is different between those two versions/
>> branches, but this might not be always the case. In Gentoo Linux
>> such a situation is solved by introducing a "slot" indicating two
>> different development trees that can be installed at the same time.
>> For Maven this would mean that the separation between (main)
>> artifacts should switch to "groupId:artifactId:slot", where slot is
>> 0 by default 
>> 
>> Is there already a proposal or doc for such kind of functionality
>> in a future release that I might have been missed?
>> 
> 
> Sorry, I'm not sure I fully understand what you're talking about. If
> you want a specific version of something why would we use a slot,
> when you can specify the version? If you want to use Webwork
> 1.x then
> you specify the version. Many versions sit happily together in the
> repository. Or are you talking about behavior that should be
> constricted to a certain version range? For example, in
> selecting the
> latest version of the 1.x family?
> 
> I'm honestly not sure what you're talking about. Maybe a problem
> trying to translate Gentoo speak to Maven?

Maven speek:


  
jmock
jmock
1.2.0
  
  
jmock
jmock
2.0.0
  


jMock 2.x is designed to be used at the same time as jMock 1.x. My code uses 
both. So how can I define the deps?

- Jörg

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Dep to same artifact in different versions

2007-04-25 Thread Jason van Zyl


On 25 Apr 07, at 8:09 AM 25 Apr 07, Jörg Schaible wrote:


Hi devs,

how will Maven handle the problem of a dependency that should be  
used in two different versions? This applies to all project that  
release a new (normally major) version that can be used with the  
old version at the same time. This is currently possible at least  
with:


jmock 1.x / jmock 2.x
webworks 1.x / webworks 2.x

Maven supprts currently only two "versions" of sa dep if  
"groupId:artifactId" is different between those two versions/ 
branches, but this might not be always the case. In Gentoo Linux  
such a situation is solved by introducing a "slot" indicating two  
different development trees that can be installed at the same time.  
For Maven this would mean that the separation between (main)  
artifacts should switch to "groupId:artifactId:slot", where slot is  
0 by default


Is there already a proposal or doc for such kind of functionality  
in a future release that I might have been missed?




Sorry, I'm not sure I fully understand what you're talking about. If  
you want a specific version of something why would we use a slot,  
when you can specify the version? If you want to use Webwork 1.x then  
you specify the version. Many versions sit happily together in the  
repository. Or are you talking about behavior that should be  
constricted to a certain version range? For example, in selecting the  
latest version of the 1.x family?


I'm honestly not sure what you're talking about. Maybe a problem  
trying to translate Gentoo speak to Maven?


Jason.


- Jörg

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Dep to same artifact in different versions

2007-04-25 Thread Jörg Schaible
Hi devs,

how will Maven handle the problem of a dependency that should be used in two 
different versions? This applies to all project that release a new (normally 
major) version that can be used with the old version at the same time. This is 
currently possible at least with:

jmock 1.x / jmock 2.x
webworks 1.x / webworks 2.x

Maven supprts currently only two "versions" of sa dep if "groupId:artifactId" 
is different between those two versions/branches, but this might not be always 
the case. In Gentoo Linux such a situation is solved by introducing a "slot" 
indicating two different development trees that can be installed at the same 
time. For Maven this would mean that the separation between (main) artifacts 
should switch to "groupId:artifactId:slot", where slot is 0 by default

Is there already a proposal or doc for such kind of functionality in a future 
release that I might have been missed?

- Jörg

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]