Activator class is not invoked when executing an Ant task
1 posts in topic
Flat View  Flat View

Posted By:   rvalcarcel
Posted On:   Friday, January 18, 2013 02:27 AM

I am working with Eclipse. I have created a plugin A that has an class A and a build.xml file.
Build.xml file defines a new task that invokes class A.
Class A has an execute() method that invokes class B. Class B is located in another plugin and I need that the Activator.start(...) method of this plugin is invoked.
However, it doesn't happen. In fact, I also verified that Activator class in plugin A is not invoked either.
"Activate this plugin when one of its classes are loaded" check box is checked in both plugins.
Please, I need help to understand why Activator classes are not invoked.


Re: Activator class is not invoked when executing an Ant task

Posted By:   rvalcarcel  
Posted On:   Monday, January 21, 2013 02:34 AM

Platform.getBundle(Activator.PLUGIN_ID). It returns the bundle id that we see in OSGI environment for my plugin A.

So, as a by pass, there is one way to force the Activator of plugin A to be initialized in AntRunner is the following one:
BundleContext context = Platform.getBundle(Activator.PLUGIN_ID).getBundleContext(); 
new Activator().start(context);

However, I would like to know the answers to:
why Ant needs a classpath when it is executed in an OSGI environment such as Eclipse (headless or normal) ? Do Ant and Equinox share the same VM or are they using different VM ?

About | Sitemap | Contact