Eclipse project structure [message #335823] |
Fri, 01 May 2009 23:16 ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
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 #335843 is a reply to message #335841] |
Mon, 04 May 2009 17:17 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
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 #335855 is a reply to message #335823] |
Tue, 05 May 2009 15:21 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
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 message Go to previous message](theme/Solstice/images/up.png) ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
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
|
|
|
|
Powered by
FUDForum. Page generated in 0.07184 seconds