You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ivy-user@ant.apache.org by Eran Bartenstein <eb...@hotmail.com> on 2007/01/28 10:09:36 UTC
Problem extending ivy tasks due to classloader usage.
Hi,
I have written my own task. My task extends the cachepath task.
However, it seems that I can not find a way to use it.
The problem is that Ivy tasks are loaded into ant classloader prior to my
taskdef decleration.
The reason it is done that way, is since I want to keep the ivy bundle
intact rather than repack it.
Also I do not want to pack all ivy jars with my project.
Thus, when trying to use my task (which requires ivy in the classapth) - if
I specify ivy jar in the taskdef classpath I get a classcast exeption (due
to different classloaders). When ommiting it - ivy jar is obviously missing
in my classpath.
Is there a way to hang one classloader under the ivy one ?
Is there another way to extend ivy tasks from my code ?
BTW - the task enables cachepath filtering for dependencies, dependending on
a set of specified extra attrbiutes.
Thanks,
Eran B.
_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it's FREE!
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
Re: Problem extending ivy tasks due to classloader usage.
Posted by St...@ipaustralia.gov.au.
Hi Eran,
if you are working with Ant 1.6.1 (or higher) have you considered using
the Ant plug-in mechanism?
e.g. <project xmlns:ivy="antlib:fr.jayasoft.ivy.ant"
xmlns:yourLib="antlib:..." >
Regards,
Stephen
"Eran Bartenstein" <eb...@hotmail.com>
29/01/2007 09:20 AM
Please respond to
ivy-user@incubator.apache.org
To
ivy-user@incubator.apache.org
cc
Subject
Problem extending ivy tasks due to classloader usage.
Hi,
I have written my own task. My task extends the cachepath task.
However, it seems that I can not find a way to use it.
The problem is that Ivy tasks are loaded into ant classloader prior to my
taskdef decleration.
The reason it is done that way, is since I want to keep the ivy bundle
intact rather than repack it.
Also I do not want to pack all ivy jars with my project.
Thus, when trying to use my task (which requires ivy in the classapth) -
if
I specify ivy jar in the taskdef classpath I get a classcast exeption (due
to different classloaders). When ommiting it - ivy jar is obviously
missing
in my classpath.
Is there a way to hang one classloader under the ivy one ?
Is there another way to extend ivy tasks from my code ?
BTW - the task enables cachepath filtering for dependencies, dependending
on
a set of specified extra attrbiutes.
Thanks,
Eran B.
_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it's FREE!
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/