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

Hi Darins,
i forgot to mention that i'm running with 3.1.1.
I knew those restrictions and i don't think i fall in those cases, at least as far as i understand the whole thing.

The plugin is really a fake one, it's just a container for a jar to be added to ant classpath as you can see in the included plugin.xml.
(something similar to org.apache.ant_1.6.5 or org.apache.lucene_1.4.3 plugins with the added extraClasspathEntry  capability).

Threre are no others plugin libraries, so the plugin classloader should not be an issue(?).

About the security exception i only see the warning marker on the editor and i see "security exception on import" when hovering on it. No other info.
Is there any way to force a stacke trace when editor catch that exception?

Thanks,  Gabriele


Darin Swanson wrote:

1 - See bug 34466 comment #7 or see the Eclipse Readme the Ant section or the
Eclipse help:
http://help.eclipse.org/help31/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@xxxxxxxxxx
email:  
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