How to access packages of plugins from java project [message #1164198] |
Thu, 31 October 2013 14:00 |
Till F. Messages: 58 Registered: August 2012 |
Member |
|
|
Hi!
I created an eclipse plugin "my.example.plugin" which runs well. The plugin contains a class "MyClass" in some package "my.example.plugin.package".
Now my problem: I'd like to access/use "MyClass" from a regular java project in another Eclipse instance (which of course has "my.example.plugin" installed). I first thought everything I would need to do was adding "my.example.plugin.package" to the list of exported packages of "my.example.plugin". Unfortunately this doesn't work.
What I can do is converting the java project into a plugin project. In this case eclipse extends the classpath corresponding to "required plugins" as defined in the MANIFEST.MF file. Then I can select "my.example.plugin" as required plugin and use any exported packages. But I'd like to stay with a regular java project (don't want MANIFEST.MF, plugins.xml etc. files). Isn't there any equivalent mechanism to add jars of installed plugins to the classpath? Of course I could add it as "external jar" but this wouldn't be a nice solution at all!
in other words: I'd like to ship a java library together with my plugin.
[Updated on: Thu, 31 October 2013 15:11] Report message to a moderator
|
|
|
Re: How to access packages of plugins from java project [message #1171738 is a reply to message #1164198] |
Tue, 05 November 2013 12:50 |
|
> What I can do is converting the java project into a plugin project. In
> this case eclipse extends the classpath corresponding to "required
> plugins" as defined in the MANIFEST.MF file. Then I can select
> "my.example.plugin" as required plugin and use any exported packages.
That's indeed the cleanest approach
> But I'd like to stay with a regular java project (don't want
> MANIFEST.MF, plugins.xml etc. files). Isn't there any equivalent
> mechanism to add jars of installed plugins to the classpath? Of course I
> could add it as "external jar" but this wouldn't be a nice solution at all!
Your Java project should reference directly (in its classpath) the jar'd
plugin.
Beware that if you original plugin uses plugin.xml and other
Eclipse-specific stuff, it may not work correctly in a plain JVM out of
the Eclipse platform.
--
Mickael Istria
My job: http://www.jboss.org/tools
My blog: http://mickaelistria.wordpress.com
My Tweets: http://twitter.com/mickaelistria
|
|
|
Powered by
FUDForum. Page generated in 0.02844 seconds