Skip to main content



      Home
Home » Newcomers » Newcomers » RCP Plugin to have dependencies which are java projects
RCP Plugin to have dependencies which are java projects [message #167866] Mon, 28 August 2006 12:59 Go to next message
Eclipse UserFriend
Originally posted by: philliprs_yahu.yahoo.com

Hi Everyone,

I just want to know if a plugin project can have a dependency from a
java project? If yes, how is this done? Thank you very much!

Phillip
Re: RCP Plugin to have dependencies which are java projects [message #168004 is a reply to message #167866] Tue, 29 August 2006 02:21 Go to previous messageGo to next message
Eclipse UserFriend
I suppose you would like to include the java project when building the
plugin project. If that is the case you can do the following thing:

Select the plugin project. Right mouse button -> Properties-> Java Build
Path. You go to the Projects tab and add the java project to the build
path of the plugin project.

Phillip wrote:

> Hi Everyone,

> I just want to know if a plugin project can have a dependency from a
> java project? If yes, how is this done? Thank you very much!

> Phillip
Re: RCP Plugin to have dependencies which are java projects [message #168157 is a reply to message #168004] Tue, 29 August 2006 10:38 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: wegener.cboenospam.com

kiril mitov wrote:

> I suppose you would like to include the java project when building the
> plugin project. If that is the case you can do the following thing:

> Select the plugin project. Right mouse button -> Properties-> Java Build
> Path. You go to the Projects tab and add the java project to the build
> path of the plugin project.

This should NEVER be done for a plugin project. In will only lead to
problems later when trying to export the plugin. In order for an exported
plugin to access the classes in the other project, they need to be on the
plugins classpath. This is done through the plugin MANIFEST.MF file. The
Java project will either need to be exported as a .jar file and added as a
dependendy, or will need to be converted to a plugin project.


> Phillip wrote:

>> Hi Everyone,

>> I just want to know if a plugin project can have a dependency from a
>> java project? If yes, how is this done? Thank you very much!

>> Phillip
Re: RCP Plugin to have dependencies which are java projects [message #168201 is a reply to message #168157] Tue, 29 August 2006 12:27 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: philliprs_yahu.yahoo.com

Yes, I think you're right. I've already done the java build path approach
before and it didn't work. (Thanks kiril, anyway ;) So does this mean that
I have to make the java projects plugins or jars? The problem is my boss
doesn't want this approach. Is there any other way while retaining the
java projects as they are? Or could I tell my boss that what he thinks is
impossible? ;)

Thank you two (Kiril and Wegener) for the help!

-Phillip
Re: RCP Plugin to have dependencies which are java projects [message #168209 is a reply to message #168201] Tue, 29 August 2006 12:30 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: philliprs_yahu.yahoo.com

(I'm sorry for the names) Thanks Kiril Mitov and Dave Wegener for the
helps so far! Looking forward for more replies, thanks again! :)

-Phillip
Re: RCP Plugin to have dependencies which are java projects [message #168235 is a reply to message #168209] Tue, 29 August 2006 13:05 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: philliprs_yahu.yahoo.com

One more thing. Is it possible to have a wrapper plugin that depends on
several java projects. And then this wrapper plugin will then be the one
added in the dependencies of the RCP application. Is this approach
possible? Or didn't I still got away with the dependency problem of a
plugin project from java project/s (since the wrapper itself is a plugin
project that depends from java projects) ;) Thanks again!
Re: RCP Plugin to have dependencies which are java projects [message #168275 is a reply to message #168235] Tue, 29 August 2006 16:12 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: wegener.cboenospam.com

Phillip wrote:

> One more thing. Is it possible to have a wrapper plugin that depends on
> several java projects. And then this wrapper plugin will then be the one
> added in the dependencies of the RCP application. Is this approach
> possible? Or didn't I still got away with the dependency problem of a
> plugin project from java project/s (since the wrapper itself is a plugin
> project that depends from java projects) ;) Thanks again!

You haven't indicated why the Java project needs to stay a Java project.
I'm assuming that it is because it is some type of library/utility project
you plan on distributing/using with more than just the plugin you are
developing. If this is the case, I would expect that you plan on turning
the project into a .jar file.

If this is the case, you should really consider making the Java project a
plugin project. The process is not very complicated. Select the project,
right click, select PDE Tools->Convert projects to plugin projects. This
will create a subdirectory called META-INF and add a MANIFEST.MF file.
Open the MANIFEST.MF file. Go to the Runtime tag and add all of your
packages to the exported packages list. The .jar file created when
exporting a plugin is a standard .jar file.

If you absolutely have to keep the Java project a Java project, you will
need to build a .jar file out of the project (File-Export->Java->jar
provides a wizard for this). You will then need get the .jar file
associated with your plugin. You can either add it to the classpath from
the PDE Manifest editor Runtime tab, or wrap the .jar file in a plugin
(see New->Project->Plugin-development->Plug-in from existing jar.)
Re: RCP Plugin to have dependencies which are java projects [message #168283 is a reply to message #168275] Tue, 29 August 2006 16:24 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: philliprs_yahu.yahoo.com

Actually, why we want the java projects to stay as one is because they're
still under work and still changing. So I think it's not advisable to make
it a jar, right? So is it really impossible for a plugin to depend on a
java project without making the latter a plugin?

Thank you very much!
Re: RCP Plugin to have dependencies which are java projects [message #168306 is a reply to message #168283] Tue, 29 August 2006 20:02 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: wegener.cboenospam.com

Phillip wrote:
>
> Actually, why we want the java projects to stay as one is because
> they're still under work and still changing. So I think it's not
> advisable to make it a jar, right? So is it really impossible for a
> plugin to depend on a java project without making the latter a plugin?
>
> Thank you very much!
>

A jar file is simply a collection of class files combined into a single
file. There is no reason to wait till the project stops changing in
order to create a jar file. Creating a jar file is a common way of
testing out a Java project.

Plugins depend on plugins. Converting the Java project to a plugin
doesn't mean that you have to export the plugin in order to test. You
can have both plugin projects in your workspace at the same time. When
launching an Eclipse application, the plugin projects in the workspace
will be used in the launch.

If you are actively developing the Java project, I would definitely turn
it into a Java project. Understand that plugin projects are simply Java
projects with a couple extra files associated with them. You won't
notice the difference between a Java project and a plugin project during
development, but it will sure make deploying your finished products easier.
Re: RCP Plugin to have dependencies which are java projects [message #168311 is a reply to message #168283] Tue, 29 August 2006 20:50 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: wharley.bea.com

"Phillip" <philliprs_yahu@yahoo.com> wrote in message
news:afa5512081372fb4d930b1ff1922c5e7$1@www.eclipse.org...
>
> Actually, why we want the java projects to stay as one is because they're
> still under work and still changing. So I think it's not advisable to make
> it a jar, right? So is it really impossible for a plugin to depend on a
> java project without making the latter a plugin?

Here's the bottom line:

* A plug-in can only depend on (a) a jar file that it contains, or (b)
another plug-in.

There are a few awkward exceptions and workarounds, none of which are really
very satisfactory. If you want to stay sane, it's best to stick to that
rule.

As Dave points out, it is very easy to wrap a jar file into a plug-in. It's
also extremely easy to turn a java project into a plug-in project. You can
even still export the classes from that project as a jar file, if you need
the jar file for other purposes.
Re: RCP Plugin to have dependencies which are java projects [message #168675 is a reply to message #168311] Thu, 31 August 2006 10:45 Go to previous message
Eclipse UserFriend
Originally posted by: philliprs_yahu.yahoo.com

Thanks for the help David and Harly. Now, I've already confirmed my
intuitions that an RCP or plugin project can't depend on a non-plugin java
project.
Previous Topic:Executable file
Next Topic:add build event to ANT
Goto Forum:
  


Current Time: Tue Jun 03 10:10:06 EDT 2025

Powered by FUDForum. Page generated in 0.07271 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top