Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Eclipse project structure
Eclipse project structure [message #335823] Fri, 01 May 2009 23:16 Go to next message
Eclipse UserFriend
Originally posted by: jean.bovet.oracle.com

Hi,

I am currently evaluating Eclipse to create an RCP version of our current
Swing application and I have a few questions concerning the way Eclipse
handles project structures:

1) In our build structure (maven), the source and resources are in separate
folders (src/main/java and src/main/resources). How can I configure Eclipse
in order to have the eclipse-project specific files (.project, .classpath)
in src/main/eclipse while having the resources in src/main/resources (e.g.
meta-inf, plugin.xml) and the code in src/main/java? I am able to link the
source files correctly but Eclipse refuses to consider the plugin as a
bundle as long as the meta-inf/MANIFEST.MF is located in src/main/resources.
Any suggestion if it is possible to achieve this setup?

2) Is it possible to specify an output folder outside the project folder?

3) All our project dependencies are located in a repository somewhere in the
disk. In the Eclipse plugin runtime settings page, the Classpath section
allows only to specify libraries located in the project (it is an RCP plugin
project). Is there a way to specify a library that is located outside a
project in the runtime classpath?

Thanks a lot,

Jean
Re: Eclipse project structure [message #335841 is a reply to message #335823] Mon, 04 May 2009 13:57 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

Jean Bovet wrote:
> Hi,
>
> I am currently evaluating Eclipse to create an RCP version of our current
> Swing application and I have a few questions concerning the way Eclipse
> handles project structures:
>
> 2) Is it possible to specify an output folder outside the project folder?

Can you create a linked folder to an external directory, and then use
that as the output folder?


> 3) All our project dependencies are located in a repository somewhere in the
> disk. In the Eclipse plugin runtime settings page, the Classpath section
> allows only to specify libraries located in the project (it is an RCP plugin
> project). Is there a way to specify a library that is located outside a
> project in the runtime classpath?

In what way ... an RCP plugin is an OSGi bundle. That means that it can
only see its Bundle-ClassPath and exported packages from other bundles.

How do you plan to use the other dependencies (I assume they are plain
java jars) in your plugin, given they must be a bundle or be included in
another bundle?

PW


--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/ganymede/index.jsp?topic=/org.eclips e.platform.doc.isv/guide/workbench.htm


Re: Eclipse project structure [message #335843 is a reply to message #335841] Mon, 04 May 2009 17:17 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jean.bovet.oracle.com

>> 2) Is it possible to specify an output folder outside the project folder?
>
> Can you create a linked folder to an external directory, and then use that
> as the output folder?

Do you mean on the file system? I am using Windows and tried a shortcut but
Eclipse re-create a bin folder next to the "bin" shortcut so it doesn't work
(unless there is another way to specify that in Eclipse).

>> 3) All our project dependencies are located in a repository somewhere in
>> the disk. In the Eclipse plugin runtime settings page, the Classpath
>> section allows only to specify libraries located in the project (it is an
>> RCP plugin project). Is there a way to specify a library that is located
>> outside a project in the runtime classpath?
>
> In what way ... an RCP plugin is an OSGi bundle. That means that it can
> only see its Bundle-ClassPath and exported packages from other bundles.
>
> How do you plan to use the other dependencies (I assume they are plain
> java jars) in your plugin, given they must be a bundle or be included in
> another bundle?

Ah... well, after thinking more about that, I realized my mistake: my bundle
has dependencies on many other bundles, log4j being one of them. I didn't
realized that I could add the log4j bundle into the Target platform and then
reference it from the Required Plugins in the Dependencies tab of my bundle
(instead of using the runtime Classpath).

Thanks,

Jean
Re: Eclipse project structure [message #335849 is a reply to message #335843] Tue, 05 May 2009 11:37 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

Jean Bovet wrote:
>>> 2) Is it possible to specify an output folder outside the project folder?
>> Can you create a linked folder to an external directory, and then use that
>> as the output folder?
>
> Do you mean on the file system? I am using Windows and tried a shortcut but
> Eclipse re-create a bin folder next to the "bin" shortcut so it doesn't work
> (unless there is another way to specify that in Eclipse).


I mean create your destination folder in windows somewhere, and then
create a "linked folder" in your workspace ... i.e. <project>/classes ->
c:\workarea\classes ... you use New>Folder and click on the Advanced
button.

Then in the java build path>source tab, select your linked folder as the
default output folder.

PW


--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/ganymede/index.jsp?topic=/org.eclips e.platform.doc.isv/guide/workbench.htm


Re: Eclipse project structure [message #335855 is a reply to message #335823] Tue, 05 May 2009 15:21 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: eclipse-news.rizzoweb.com

Jean Bovet wrote:
> Hi,
>
> I am currently evaluating Eclipse to create an RCP version of our current
> Swing application and I have a few questions concerning the way Eclipse
> handles project structures:
>
> 1) In our build structure (maven), the source and resources are in separate
> folders (src/main/java and src/main/resources). How can I configure Eclipse
> in order to have the eclipse-project specific files (.project, .classpath)
> in src/main/eclipse while having the resources in src/main/resources (e.g.
> meta-inf, plugin.xml) and the code in src/main/java? I am able to link the
> source files correctly but Eclipse refuses to consider the plugin as a
> bundle as long as the meta-inf/MANIFEST.MF is located in src/main/resources.
> Any suggestion if it is possible to achieve this setup?

No, the Eclipse-specific files need to be in the specific places (mostly
in the root of the project, except for manifest.mf which must be under
meta-inf. These are "bootstrap" files that Eclipse has to know exactly
where to kind in order to know what kind of project it is and how to
handle it.
There is a feature request to allow some flexibility in the placement of
some of these files, but it is not something that will be implemented
soon (ie, not for the upcoming 3.5 release).

There are usually ways to structure the Eclipse Project (note the
capital P) to get along with an existing project (not the little p)
structure. The Help has a tutorial under the Java Development guide
(online version is here:
http://help.eclipse.org/ganymede/topic/org.eclipse.jdt.doc.u ser/gettingStarted/qs-ProjectConfiguration.htm)

For example, if the root of your project structure is MyProject/ then
you would ideally have this:

MyProject/
.project
.classpath
plugin.xml
plugin.properties
meta-inf/
MANIFEST.MF
src/
main/
java/
<.java files live under here>
resources/
<non-Java files live here>

Normally, everything there would be checked in. If you explain exactly
why that kind of structure does not work for you, we might be able to
offer work-arounds or alternative solutions to satisfy your existing
project needs.

Hope this helps,
Eric
Re: Eclipse project structure [message #335890 is a reply to message #335855] Thu, 07 May 2009 21:07 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jean.bovet.oracle.com

> For example, if the root of your project structure is MyProject/ then
> you would ideally have this:
>
> MyProject/
> .project
> .classpath
> plugin.xml
> plugin.properties
> meta-inf/
> MANIFEST.MF
> src/
> main/
> java/
> <.java files live under here>
> resources/
> <non-Java files live here>
>
> Normally, everything there would be checked in. If you explain exactly why
> that kind of structure does not work for you, we might be able to offer
> work-arounds or alternative solutions to satisfy your existing project
> needs.

Thanks for these explanations. Our project is structured a bit like the one
you mentioned above, like that:

MyProject/
eclipse/
.project
.classpath
plugin.xml
plugin.properties
src/
main/
java/
<.java files live under here>
resources/
icons/
meta-inf/
MANIFEST.MF

With this structure, I am facing to problems:
1) We have already a manifest file but located in main/resources. Is there a
way to indicate to Eclipse to use this one? I would like to avoid having
duplicated files.
2) In main/resources, we have some images under icons/. Again, is there a
way to indicate to Eclipse to use that folder as a resource folder (e.g. so
that the bundle will have an entry path icons/ in it)?

What I am doing right now is to put the Eclipse Project root in
main/resources but I would like to move it somewhere else because the
project specific files like .project and .classpath don't belong to the
bundle resource.

Thanks,

Jean
Re: Eclipse project structure [message #335891 is a reply to message #335849] Thu, 07 May 2009 21:11 Go to previous message
Eclipse UserFriend
Originally posted by: jean.bovet.oracle.com

Awesome. Thanks for the tip!

Jean

"Paul Webster" <pwebster@ca.ibm.com> wrote in message
news:gtp8eh$ure$1@build.eclipse.org...
> Jean Bovet wrote:
>>>> 2) Is it possible to specify an output folder outside the project
>>>> folder?
>>> Can you create a linked folder to an external directory, and then use
>>> that as the output folder?
>>
>> Do you mean on the file system? I am using Windows and tried a shortcut
>> but Eclipse re-create a bin folder next to the "bin" shortcut so it
>> doesn't work (unless there is another way to specify that in Eclipse).
>
>
> I mean create your destination folder in windows somewhere, and then
> create a "linked folder" in your workspace ... i.e. <project>/classes ->
> c:\workarea\classes ... you use New>Folder and click on the Advanced
> button.
>
> Then in the java build path>source tab, select your linked folder as the
> default output folder.
>
> PW
>
>
> --
> Paul Webster
> http://wiki.eclipse.org/Platform_Command_Framework
> http://wiki.eclipse.org/Command_Core_Expressions
> http://wiki.eclipse.org/Menu_Contributions
> http://wiki.eclipse.org/Menus_Extension_Mapping
> http://help.eclipse.org/ganymede/index.jsp?topic=/org.eclips e.platform.doc.isv/guide/workbench.htm
Previous Topic:Single Checkable CheckboxTableViewer
Next Topic:Help required on org.eclipse.osgi
Goto Forum:
  


Current Time: Fri Apr 26 22:02:21 GMT 2024

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

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

Back to the top