You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Jason van Zyl <ja...@zenplex.com> on 2003/03/01 19:30:31 UTC
ClassLoader and Properties handling behaviour
Hi,
I'm am not up all all the new features for the next release of Ant but I
have heard that it is now possible to specify ClassLoaders and
Properties handlers. Is this true?
In Maven we embed the use of Ant and I would like Ant to use the
ClassWorlds (classworlds.werken.com) mechanism we have in place and
remove the use the commons-sandbox Grant project.
If this is indeed true could someone point me at the the relevant code?
Also, someone pointed James at the lifecycle document for taskdefs but
can't seem to find it, could someone point me at that also?
--
jvz.
Jason van Zyl
jason@zenplex.com
http://tambora.zenplex.org
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
Re: ClassLoader and Properties handling behaviour
Posted by Jason van Zyl <ja...@zenplex.com>.
On Mon, 2003-03-03 at 07:35, Conor MacNeill wrote:
> Jason van Zyl wrote:
> > Hi,
> >
> > I
> > have heard that it is now possible to specify ClassLoaders and
> > Properties handlers. Is this true?
>
> These are experimental at this stage. They have been added but not used much
> or extensively tested. I think more work remains in this areas.
No problem. I have found a way to override the AntClassLoader.
> >
> > In Maven we embed the use of Ant and I would like Ant to use the
> > ClassWorlds (classworlds.werken.com) mechanism we have in place and
> > remove the use the commons-sandbox Grant project.
>
> We are not using Grant at the moment. I think you are probably referring to
> Maven, but just to be clear. As for ClassWorlds, how would you envisage this
> would be used in Ant? I'm not clear where it would fit.
ClassWorlds is what is going to be used to fully control classloading in
Maven. It is also being used in the Plexus avalon-based container which
is what Maven will eventually sit upon.
> Also, I'm a little concerned about violating the classloading hierarchy - it
> leads to Linkage errors in my experience. I have the same concern with the
> ClassLoader task.
Well, I plan to by pass the classloading mechanism which is controlled
by ClassWorlds. ClassLoading in general is much easier to control using
ClassWorlds. I'm definitely aware of potential problems but I've got my
share of ClassLoader experience :-)
> >
> > If this is indeed true could someone point me at the the relevant code?
>
> The ClassLoader task is here
> http://cvs.apache.org/viewcvs.cgi/ant/src/main/org/apache/tools/ant/taskdefs/Classloader.java
>
> The PropertyHelper clas is here but you'll need to follow the relationships
> to see how it is used
> http://cvs.apache.org/viewcvs.cgi/ant/src/main/org/apache/tools/ant/PropertyHelper.java
>
> >
> > Also, someone pointed James at the lifecycle document for taskdefs but
> > can't seem to find it, could someone point me at that also?
> >
>
> I don't know who James is in this case, but the document is here
> http://ant.apache.org/manual/develop.html#writingowntask
Cool, much appreciated!
> Conor
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
> For additional commands, e-mail: dev-help@ant.apache.org
--
jvz.
Jason van Zyl
jason@zenplex.com
http://tambora.zenplex.org
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
Re: ClassLoader and Properties handling behaviour
Posted by Costin Manolache <cm...@yahoo.com>.
Conor MacNeill wrote:
> Also, I'm a little concerned about violating the classloading hierarchy -
> it leads to Linkage errors in my experience. I have the same concern with
> the ClassLoader task.
The ClassLoader task is no longer using the classloading hierarchy - the
initial version did, and it resulted in the expected Linkage errors ( and
related workarounds ). This was needed in [embed] to work around ant1.5
limitations - but when I merged I removed all the hacks, they are not needed
in 1.6.
By default it'll just add more jars to the main ant loader - and rely on the
lazy creation of tasks.
The <classloader> task can be extended to deal with hierarchies and
direct/reverse delegation - but the most common use will be to extend the
main ant loader.
Costin
Re: ClassLoader and Properties handling behaviour
Posted by Conor MacNeill <co...@cortexebusiness.com.au>.
Jason van Zyl wrote:
> Hi,
>
> I
> have heard that it is now possible to specify ClassLoaders and
> Properties handlers. Is this true?
These are experimental at this stage. They have been added but not used much
or extensively tested. I think more work remains in this areas.
>
> In Maven we embed the use of Ant and I would like Ant to use the
> ClassWorlds (classworlds.werken.com) mechanism we have in place and
> remove the use the commons-sandbox Grant project.
We are not using Grant at the moment. I think you are probably referring to
Maven, but just to be clear. As for ClassWorlds, how would you envisage this
would be used in Ant? I'm not clear where it would fit.
Also, I'm a little concerned about violating the classloading hierarchy - it
leads to Linkage errors in my experience. I have the same concern with the
ClassLoader task.
>
> If this is indeed true could someone point me at the the relevant code?
The ClassLoader task is here
http://cvs.apache.org/viewcvs.cgi/ant/src/main/org/apache/tools/ant/taskdefs/Classloader.java
The PropertyHelper clas is here but you'll need to follow the relationships
to see how it is used
http://cvs.apache.org/viewcvs.cgi/ant/src/main/org/apache/tools/ant/PropertyHelper.java
>
> Also, someone pointed James at the lifecycle document for taskdefs but
> can't seem to find it, could someone point me at that also?
>
I don't know who James is in this case, but the document is here
http://ant.apache.org/manual/develop.html#writingowntask
Conor