You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Jason van Zyl <jv...@sonatype.com> on 2009/03/24 00:51:10 UTC
deprecating MavenSession.lookup( role|class ) and prefer injection in plugins
Hi,
I would like to remove the MavenSession.lookup( class|role ) methods
in Maven 3.x so I would like to start deprecating them and prefer
injecting anything required using a javadoc annotation (current plugin
api) and an annotation (the new plugin api).
General access to the container is not required more with the new
annotation-based Plexus containers and it's really a bad practice not
to have injected all the things you need.
Plexus used in Maven 3.x injects collections properly and as new
components enter the system they find their way into the correct
collections. So, for example, if a new lifecycle mapping is discovered
in the system it will just automatically show up it the
Map<String,Lifecycle> inside the LifecycleExecutor. This was the
primary reason why we exposed the container and it's not required
anymore.
So if we deprecate starting now, folks will know long before Maven 3.x
comes out.
Thanks,
Jason
----------------------------------------------------------
Jason van Zyl
Founder, Apache Maven
http://twitter.com/jvanzyl
----------------------------------------------------------
Our achievements speak for themselves. What we have to keep track
of are our failures, discouragements and doubts. We tend to forget
the past difficulties, the many false starts, and the painful
groping. We see our past achievements as the end result of a
clean forward thrust, and our present difficulties as
signs of decline and decay.
-- Eric Hoffer, Reflections on the Human Condition
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
Re: deprecating MavenSession.lookup( role|class ) and prefer injection
in plugins
Posted by John Casey <jd...@commonjava.org>.
Sure, but do you expect 2.x compatible plugins to be useful in 3.0? If
so, then we'll need some sort of migration path that follows real
deprecation...which means giving them a workable alternative before 3.0
comes out and takes away the deprecated stuff. Plugin devs will need a
release platform that supports both.
Jason van Zyl wrote:
>
> On 24-Mar-09, at 8:08 AM, John Casey wrote:
>
>> There's a similar thing happening in the assembly plugin, for
>> component descriptor handlers (the things that merge various
>> descriptors when there is a collision, rather than simply replacing
>> one with another). It might work out alright to simply load a
>> collection of these, then pick the correct one...
>>
>> One thing about it though: we're going to need to release an
>> intermediate version (2.2.x?) that contains a plexus version which can
>> inject collections properly, if we're going to migrate the plugins
>> over in anticipation of 3.0. Since the version of plexus used in 2.1.0
>> doesn't handle collections properly (still using alpha-9), we can't
>> really migrate away before 3.0 otherwise, which means 3.0 will still
>> have to support lookup(..) in some form.
>>
>
> The session lookup can stay in 2.x.x forever really. I don't want to do
> any work in the 2.x.x line to support the new container I just want
> people to know it's deprecated. When they switch to 3.0 it's not going
> to be there.
>
>> -john
>>
>> Brian E. Fox wrote:
>>> The enforcer uses this to hand components over to the rules via a get
>>> Component method (it implements the expressionevaluator interface). I
>>> would probably need to convert all the rules over to actual plexus
>>> components to use injection.
>>> -----Original Message-----
>>> From: Jason van Zyl [mailto:jvanzyl@sonatype.com] Sent: Monday, March
>>> 23, 2009 7:51 PM
>>> To: Maven Developers List
>>> Subject: deprecating MavenSession.lookup( role|class ) and prefer
>>> injection in plugins
>>> Hi,
>>> I would like to remove the MavenSession.lookup( class|role ) methods
>>> in Maven 3.x so I would like to start deprecating them and prefer
>>> injecting anything required using a javadoc annotation (current
>>> plugin api) and an annotation (the new plugin api).
>>> General access to the container is not required more with the new
>>> annotation-based Plexus containers and it's really a bad practice
>>> not to have injected all the things you need.
>>> Plexus used in Maven 3.x injects collections properly and as new
>>> components enter the system they find their way into the correct
>>> collections. So, for example, if a new lifecycle mapping is
>>> discovered in the system it will just automatically show up it the
>>> Map<String,Lifecycle> inside the LifecycleExecutor. This was the
>>> primary reason why we exposed the container and it's not required
>>> anymore.
>>> So if we deprecate starting now, folks will know long before Maven
>>> 3.x comes out.
>>> Thanks,
>>> Jason
>>> ----------------------------------------------------------
>>> Jason van Zyl
>>> Founder, Apache Maven
>>> http://twitter.com/jvanzyl
>>> ----------------------------------------------------------
>>> Our achievements speak for themselves. What we have to keep track
>>> of are our failures, discouragements and doubts. We tend to forget
>>> the past difficulties, the many false starts, and the painful
>>> groping. We see our past achievements as the end result of a
>>> clean forward thrust, and our present difficulties as
>>> signs of decline and decay.
>>> -- Eric Hoffer, Reflections on the Human Condition
>>> ---------------------------------------------------------------------
>>> 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
>>
>> ---------------------------------------------------------------------
>> 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, Apache Maven
> http://twitter.com/jvanzyl
> ----------------------------------------------------------
>
> In short, man creates for himself a new religion of a rational
> and technical order to justify his work and to be justified in it.
>
> -- Jacques Ellul, The Technological Society
>
>
> ---------------------------------------------------------------------
> 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: deprecating MavenSession.lookup( role|class ) and prefer injection in plugins
Posted by Jason van Zyl <jv...@sonatype.com>.
On 24-Mar-09, at 8:08 AM, John Casey wrote:
> There's a similar thing happening in the assembly plugin, for
> component descriptor handlers (the things that merge various
> descriptors when there is a collision, rather than simply replacing
> one with another). It might work out alright to simply load a
> collection of these, then pick the correct one...
>
> One thing about it though: we're going to need to release an
> intermediate version (2.2.x?) that contains a plexus version which
> can inject collections properly, if we're going to migrate the
> plugins over in anticipation of 3.0. Since the version of plexus
> used in 2.1.0 doesn't handle collections properly (still using
> alpha-9), we can't really migrate away before 3.0 otherwise, which
> means 3.0 will still have to support lookup(..) in some form.
>
The session lookup can stay in 2.x.x forever really. I don't want to
do any work in the 2.x.x line to support the new container I just want
people to know it's deprecated. When they switch to 3.0 it's not going
to be there.
> -john
>
> Brian E. Fox wrote:
>> The enforcer uses this to hand components over to the rules via a get
>> Component method (it implements the expressionevaluator interface). I
>> would probably need to convert all the rules over to actual plexus
>> components to use injection.
>> -----Original Message-----
>> From: Jason van Zyl [mailto:jvanzyl@sonatype.com] Sent: Monday,
>> March 23, 2009 7:51 PM
>> To: Maven Developers List
>> Subject: deprecating MavenSession.lookup( role|class ) and prefer
>> injection in plugins
>> Hi,
>> I would like to remove the MavenSession.lookup( class|role )
>> methods in Maven 3.x so I would like to start deprecating them and
>> prefer injecting anything required using a javadoc annotation
>> (current plugin api) and an annotation (the new plugin api).
>> General access to the container is not required more with the new
>> annotation-based Plexus containers and it's really a bad practice
>> not to have injected all the things you need.
>> Plexus used in Maven 3.x injects collections properly and as new
>> components enter the system they find their way into the correct
>> collections. So, for example, if a new lifecycle mapping is
>> discovered in the system it will just automatically show up it
>> the Map<String,Lifecycle> inside the LifecycleExecutor. This was
>> the primary reason why we exposed the container and it's not
>> required anymore.
>> So if we deprecate starting now, folks will know long before Maven
>> 3.x comes out.
>> Thanks,
>> Jason
>> ----------------------------------------------------------
>> Jason van Zyl
>> Founder, Apache Maven
>> http://twitter.com/jvanzyl
>> ----------------------------------------------------------
>> Our achievements speak for themselves. What we have to keep track
>> of are our failures, discouragements and doubts. We tend to forget
>> the past difficulties, the many false starts, and the painful
>> groping. We see our past achievements as the end result of a
>> clean forward thrust, and our present difficulties as
>> signs of decline and decay.
>> -- Eric Hoffer, Reflections on the Human Condition
>> ---------------------------------------------------------------------
>> 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
>
> ---------------------------------------------------------------------
> 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, Apache Maven
http://twitter.com/jvanzyl
----------------------------------------------------------
In short, man creates for himself a new religion of a rational
and technical order to justify his work and to be justified in it.
-- Jacques Ellul, The Technological Society
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
Re: deprecating MavenSession.lookup( role|class ) and prefer injection
in plugins
Posted by John Casey <jd...@commonjava.org>.
There's a similar thing happening in the assembly plugin, for component
descriptor handlers (the things that merge various descriptors when
there is a collision, rather than simply replacing one with another). It
might work out alright to simply load a collection of these, then pick
the correct one...
One thing about it though: we're going to need to release an
intermediate version (2.2.x?) that contains a plexus version which can
inject collections properly, if we're going to migrate the plugins over
in anticipation of 3.0. Since the version of plexus used in 2.1.0
doesn't handle collections properly (still using alpha-9), we can't
really migrate away before 3.0 otherwise, which means 3.0 will still
have to support lookup(..) in some form.
Agree? Disagree?
-john
Brian E. Fox wrote:
> The enforcer uses this to hand components over to the rules via a get
> Component method (it implements the expressionevaluator interface). I
> would probably need to convert all the rules over to actual plexus
> components to use injection.
>
> -----Original Message-----
> From: Jason van Zyl [mailto:jvanzyl@sonatype.com]
> Sent: Monday, March 23, 2009 7:51 PM
> To: Maven Developers List
> Subject: deprecating MavenSession.lookup( role|class ) and prefer
> injection in plugins
>
> Hi,
>
> I would like to remove the MavenSession.lookup( class|role ) methods
> in Maven 3.x so I would like to start deprecating them and prefer
> injecting anything required using a javadoc annotation (current plugin
> api) and an annotation (the new plugin api).
>
> General access to the container is not required more with the new
> annotation-based Plexus containers and it's really a bad practice not
> to have injected all the things you need.
>
> Plexus used in Maven 3.x injects collections properly and as new
> components enter the system they find their way into the correct
> collections. So, for example, if a new lifecycle mapping is discovered
> in the system it will just automatically show up it the
> Map<String,Lifecycle> inside the LifecycleExecutor. This was the
> primary reason why we exposed the container and it's not required
> anymore.
>
> So if we deprecate starting now, folks will know long before Maven 3.x
> comes out.
>
> Thanks,
>
> Jason
>
> ----------------------------------------------------------
> Jason van Zyl
> Founder, Apache Maven
> http://twitter.com/jvanzyl
> ----------------------------------------------------------
>
> Our achievements speak for themselves. What we have to keep track
> of are our failures, discouragements and doubts. We tend to forget
> the past difficulties, the many false starts, and the painful
> groping. We see our past achievements as the end result of a
> clean forward thrust, and our present difficulties as
> signs of decline and decay.
>
> -- Eric Hoffer, Reflections on the Human Condition
>
>
> ---------------------------------------------------------------------
> 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
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
RE: deprecating MavenSession.lookup( role|class ) and prefer injection in plugins
Posted by "Brian E. Fox" <br...@reply.infinity.nu>.
The enforcer uses this to hand components over to the rules via a get
Component method (it implements the expressionevaluator interface). I
would probably need to convert all the rules over to actual plexus
components to use injection.
-----Original Message-----
From: Jason van Zyl [mailto:jvanzyl@sonatype.com]
Sent: Monday, March 23, 2009 7:51 PM
To: Maven Developers List
Subject: deprecating MavenSession.lookup( role|class ) and prefer
injection in plugins
Hi,
I would like to remove the MavenSession.lookup( class|role ) methods
in Maven 3.x so I would like to start deprecating them and prefer
injecting anything required using a javadoc annotation (current plugin
api) and an annotation (the new plugin api).
General access to the container is not required more with the new
annotation-based Plexus containers and it's really a bad practice not
to have injected all the things you need.
Plexus used in Maven 3.x injects collections properly and as new
components enter the system they find their way into the correct
collections. So, for example, if a new lifecycle mapping is discovered
in the system it will just automatically show up it the
Map<String,Lifecycle> inside the LifecycleExecutor. This was the
primary reason why we exposed the container and it's not required
anymore.
So if we deprecate starting now, folks will know long before Maven 3.x
comes out.
Thanks,
Jason
----------------------------------------------------------
Jason van Zyl
Founder, Apache Maven
http://twitter.com/jvanzyl
----------------------------------------------------------
Our achievements speak for themselves. What we have to keep track
of are our failures, discouragements and doubts. We tend to forget
the past difficulties, the many false starts, and the painful
groping. We see our past achievements as the end result of a
clean forward thrust, and our present difficulties as
signs of decline and decay.
-- Eric Hoffer, Reflections on the Human Condition
---------------------------------------------------------------------
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: deprecating MavenSession.lookup( role|class ) and prefer injection in plugins
Posted by Jason van Zyl <jv...@sonatype.com>.
On 23-Mar-09, at 5:24 PM, Brett Porter wrote:
>
> On 24/03/2009, at 11:15 AM, Jason van Zyl wrote:
>
>>> I assume that means "we can use this internally, but don't use it
>>> from plugins".
>>>
>>
>> You won't need it internally either, and I currently don't see use
>> of session.lookup( x|y ) in the core.
>
> I was thinking of in 2.1, but actually it's probably going straight
> to the container.
>
It uses the container but everything can be inject now safely.
> The one place I think it is used is the toolchains - that needs work
> anyway as you can't provide new ones even with extensions in 2.0.x/
> 2.1.x. Sounds like they should just work under the container changes.
>
> Cheers,
> Brett
>
> --
> Brett Porter
> brett@apache.org
> http://blogs.exist.com/bporter/
>
>
> ---------------------------------------------------------------------
> 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, Apache Maven
http://twitter.com/jvanzyl
----------------------------------------------------------
Simplex sigillum veri. (Simplicity is the seal of truth.)
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
Re: deprecating MavenSession.lookup( role|class ) and prefer injection in plugins
Posted by Brett Porter <br...@apache.org>.
On 24/03/2009, at 11:15 AM, Jason van Zyl wrote:
>> I assume that means "we can use this internally, but don't use it
>> from plugins".
>>
>
> You won't need it internally either, and I currently don't see use
> of session.lookup( x|y ) in the core.
I was thinking of in 2.1, but actually it's probably going straight to
the container.
The one place I think it is used is the toolchains - that needs work
anyway as you can't provide new ones even with extensions in 2.0.x/
2.1.x. Sounds like they should just work under the container changes.
Cheers,
Brett
--
Brett Porter
brett@apache.org
http://blogs.exist.com/bporter/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
Re: deprecating MavenSession.lookup( role|class ) and prefer injection in plugins
Posted by Jason van Zyl <jv...@sonatype.com>.
On 23-Mar-09, at 5:02 PM, Brett Porter wrote:
> +1, so you'll add the deprecation to maven-2.1.x?
>
If no one has a problem with it, yes.
> I assume that means "we can use this internally, but don't use it
> from plugins".
>
You won't need it internally either, and I currently don't see use of
session.lookup( x|y ) in the core.
> - Brett
>
> On 24/03/2009, at 10:51 AM, Jason van Zyl wrote:
>
>> Hi,
>>
>> I would like to remove the MavenSession.lookup( class|role )
>> methods in Maven 3.x so I would like to start deprecating them and
>> prefer injecting anything required using a javadoc annotation
>> (current plugin api) and an annotation (the new plugin api).
>>
>> General access to the container is not required more with the new
>> annotation-based Plexus containers and it's really a bad practice
>> not to have injected all the things you need.
>>
>> Plexus used in Maven 3.x injects collections properly and as new
>> components enter the system they find their way into the correct
>> collections. So, for example, if a new lifecycle mapping is
>> discovered in the system it will just automatically show up it the
>> Map<String,Lifecycle> inside the LifecycleExecutor. This was the
>> primary reason why we exposed the container and it's not required
>> anymore.
>>
>> So if we deprecate starting now, folks will know long before Maven
>> 3.x comes out.
>>
>> Thanks,
>>
>> Jason
>>
>> ----------------------------------------------------------
>> Jason van Zyl
>> Founder, Apache Maven
>> http://twitter.com/jvanzyl
>> ----------------------------------------------------------
>>
>> Our achievements speak for themselves. What we have to keep track
>> of are our failures, discouragements and doubts. We tend to forget
>> the past difficulties, the many false starts, and the painful
>> groping. We see our past achievements as the end result of a
>> clean forward thrust, and our present difficulties as
>> signs of decline and decay.
>>
>> -- Eric Hoffer, Reflections on the Human Condition
>>
>>
>> ---------------------------------------------------------------------
>> 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://blogs.exist.com/bporter/
>
>
> ---------------------------------------------------------------------
> 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, Apache Maven
http://twitter.com/jvanzyl
----------------------------------------------------------
A language that doesn’t affect the way you think about programming is
not worth knowing.
-— Alan Perlis
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
Re: deprecating MavenSession.lookup( role|class ) and prefer injection in plugins
Posted by Brett Porter <br...@apache.org>.
+1, so you'll add the deprecation to maven-2.1.x?
I assume that means "we can use this internally, but don't use it from
plugins".
- Brett
On 24/03/2009, at 10:51 AM, Jason van Zyl wrote:
> Hi,
>
> I would like to remove the MavenSession.lookup( class|role ) methods
> in Maven 3.x so I would like to start deprecating them and prefer
> injecting anything required using a javadoc annotation (current
> plugin api) and an annotation (the new plugin api).
>
> General access to the container is not required more with the new
> annotation-based Plexus containers and it's really a bad practice
> not to have injected all the things you need.
>
> Plexus used in Maven 3.x injects collections properly and as new
> components enter the system they find their way into the correct
> collections. So, for example, if a new lifecycle mapping is
> discovered in the system it will just automatically show up it the
> Map<String,Lifecycle> inside the LifecycleExecutor. This was the
> primary reason why we exposed the container and it's not required
> anymore.
>
> So if we deprecate starting now, folks will know long before Maven
> 3.x comes out.
>
> Thanks,
>
> Jason
>
> ----------------------------------------------------------
> Jason van Zyl
> Founder, Apache Maven
> http://twitter.com/jvanzyl
> ----------------------------------------------------------
>
> Our achievements speak for themselves. What we have to keep track
> of are our failures, discouragements and doubts. We tend to forget
> the past difficulties, the many false starts, and the painful
> groping. We see our past achievements as the end result of a
> clean forward thrust, and our present difficulties as
> signs of decline and decay.
>
> -- Eric Hoffer, Reflections on the Human Condition
>
>
> ---------------------------------------------------------------------
> 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://blogs.exist.com/bporter/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org