Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-ant-dev] Problems using custom ant task

Well Darins,
it turned out you were right.
I assumed that when not declaring a <runtime> tag, the plugin classloader was ignoring the plugin content. That's not the case, it looks that by default the plugin classloader loads whatever jars it find in plugin root. It was enough to move the task jar in a lib directory changing the <extraClasspathEntry> accordingly, to have the task running both within and outside eclipse jvm.

I'm still stuck though with that security exception.
I've been able to determine that it's an AntSecurityException, but in my task i do not set ant System property and i don't see any property setting neither in ant Get class nor ImportTask class that i call from my task.
Is there any other condition that can lead to AntSecurityException?
Is there a way to force the editor to take a stack trace when it catch an exception?

I'm sorry to abuse again of your kindness, but if you just could point me in the right direction...

Gabriele

Darin Swanson wrote:


1 - See _bug 34466 comment #7_ <https://bugs.eclipse.org/bugs/show_bug.cgi?id=34466#c7> or see the Eclipse Readme the Ant section or the
Eclipse help:
_http://help.eclipse.org/help31/index.jsp_ <http://help.eclipse.org/help21/index.jsp>?topic=/org.eclipse.platform.doc.isv/guide/ant_contributing_task.htm
"Important rules..." section

2- Is this an AntSecurityException? Later in 3.1 we had a bug in the Ant editor similar to this...see bug 86174. If you are using 3.2 and please log a bug report against Platform-Ant with a build file etc to reproduce the problem and I will be happy to take a look to determine the root of the problem

Thanks
Darins



*Gabriele Garuglieri <gabriele.garuglieri@xxxxxxxxxx>*
Sent by: platform-ant-dev-bounces@xxxxxxxxxxx

10/10/2005 01:12 AM
Please respond to
"Eclipse Ant integration developers list."


	
To
	platform-ant-dev@xxxxxxxxxxx
cc
	
Subject
	[platform-ant-dev] Problems using custom ant task



	





Hi all,
i'm having problems using a custom ant task within eclipse.

I wrote a custom task as an extension of import, i.e. it can import ant build files from a remote location via http url. It first downloads the remote file in a specified directory using the org.apache.tools.ant.taskdefs.Get class then imports the local file via the org.apache.tools.ant.taskdefs.ImportTask.

The task works without problems both when i launch ant standalone and when i launch ant from eclipse using a separate jre, but i have a couple of problems trying to use it from within eclipse:

1- the first is that if i try to launch the ant file that uses the custom task using the same jre as eclipse it looks the Task is not completely initialized when it is executed, because for instance the same org.apache.tools.ant.ProjectComponent.getProject() method that returns a valid Project reference when the build file is launched with a separate jre, always return null when the build file is launched with the same jre as eclipse and the org.apache.tools.ant.Task.getTaskName() and org.apache.tools.ant.Task.getOwningTarget() returns null too.

2- the other problem is that when i set Get.setUseTimestamp(true), when i edit the build file the imported file is downloaded, but the import task is maked with a warning "Security exception" and i cannot see the imported tasks in Ant view. If i set Get.setUseTimestamp(false) then the file is downloaded and imported and i can see the imported tasks in Ant view. I examined many times the Get code but i couldn't imagine what could be causing eclipse to throw a security exception when Get.setUseTimestamp(true).

The task is installed as a plugin with the following plugin.xml:
<plugin>

   <extension point="org.eclipse.ant.core.extraClasspathEntries">
<extraClasspathEntry library="ACL-auto-ant.jar" eclipseRuntime="false"/>
   </extension>

</plugin>
and called using
xmlns:auto="antlib:it.autostrade.commonlib.ant"

Is there anybody that could explain this different ant beahviour when run within eclipse and the causes for security exceptions?

Thanks in advance, Gabriele
--

Gabriele Garuglieri
Infoblu S.p.A
Sistemi di Viabilità
Nuovo Centro Direzionale
Autostrade // per l'Italia
Svincolo Autostradale Firenze Nord
50013 Campi Bisenzio - Firenze
========================================
email: _gabriele.garuglieri@infoblu.it_ <mailto:gabriele.garuglieri@xxxxxxxxxx>
email:  _ggaruglieri@autostrade.it_ <mailto:ggaruglieri@xxxxxxxxxxxxx>
phone:  +39.055.420.2832
mobile: +39.335.1053305
========================================_______________________________________________
platform-ant-dev mailing list
platform-ant-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/platform-ant-dev

------------------------------------------------------------------------

_______________________________________________
platform-ant-dev mailing list
platform-ant-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/platform-ant-dev

--

Gabriele Garuglieri
Infoblu S.p.A
Sistemi di Viabilità
Nuovo Centro Direzionale
Autostrade // per l'Italia
Svincolo Autostradale Firenze Nord
50013 Campi Bisenzio - Firenze
========================================
email:  gabriele.garuglieri@xxxxxxxxxx
email:  ggaruglieri@xxxxxxxxxxxxx
phone:  +39.055.420.2832
mobile: +39.335.1053305
========================================




Back to the top