Skip to main content



      Home
Home » Newcomers » Newcomers » Project Structure matching Filesystem Structure(New to eclipse and this is driving me INSANE)
Project Structure matching Filesystem Structure [message #1797511] Wed, 31 October 2018 21:09 Go to next message
Eclipse UserFriend
I've been working with Eclipse for a few years now but only recently have started to work on very large projects with eclipse (with hundreds of subprojects / pom.xml). But, I just can't seem to get Eclipse to organize my workspace in a way that makes any kind of sense at all. Why is it so hard?

So, with these big projects I am working on, they are broken up into lots of subprojects. So for example, the structure on my filesystem is as follows:

Project
    -Subproject1
        -Subproject1.1
            src/java/foo/bar/...
            pom.xml
        -Subproject1.2
            src/java/foo/bar/...
            pom.xml
        -Subproject1.3
            src/java/foo/oof/...
            pom.xml
        pom.xml
    -Subproject2
        -Subproject2.1
            src/java/com/test/...
            pom.xml
        -Subproject2.2
            src/java/foo/bar/...
            pom.xml
        -Subproject2.3
            src/java/foo/oof/...
            pom.xml
        pom.xml
    pom.xml

This is great. It makes perfect sense to me and I can understand the flow perfectly. However, Eclipse just for whatever reason refuses to organize the projects like this. Instead, it wants to do this....

Project
Subproject1
Subproject2
Subproject1.1
Subproject1.2
Subproject1.3
Subproject2.1
Subproject2.2
Subproject2.3

It doesn't look too bad when there is only this small amount, but you must keep in mind that when I have ~400 projects/subprojects like this, all sorted alphabetically, it becomes impossible to keep track of what code is where.

I've been able to get the workspace layout to mirror the file system, by only importing the root level pom.xml. However, whenever I do that I lose all actual eclipse functionality - whenever I try to do anything I'm told "The resource is not on the build path of an eclipse project".

Why? That just makes things extremely confusing for me. Why can't eclipse just mirror what's on my file system? Is there any way to get eclipse to do this without losing any eclipse functionality or duplicating projects in the workspace?

HELP!

[Updated on: Wed, 31 October 2018 22:01] by Moderator

Re: Project Structure matching Filesystem Structure [message #1797524 is a reply to message #1797511] Thu, 01 November 2018 02:48 Go to previous messageGo to next message
Eclipse UserFriend
No, this is not really a good structure to use with Eclipse. The workspace model does not support nested projects. At the root of the workspace are projects and a given bproject can only contain folders and file.

You can organize projects into Working Sets, and via the Properties of a given project you can use Resource -> Resource Filters to omit nested folders so that the file system folder for a subproject is not duplicated in the parent project when viewed in your workspace. But that's the best you can do.
Re: Project Structure matching Filesystem Structure [message #1797571 is a reply to message #1797524] Thu, 01 November 2018 18:30 Go to previous messageGo to next message
Eclipse UserFriend
Why is it not a good structure? It's the only thing that makes any sense. Looking at my projects list like

api
basic
calendar
cloud
dav
deploy
direct
endorsed
entitybroker
jsf
jsf2
kernel
impl
presence
portlet
profile
providers
test


Might be the most uninformative layout I have ever seen. I need to know the parent folders of all of those to make any sense of the layout.

Quite honestly I'm having trouble understanding how anybody is able to use Eclipse to work on any large projects when the workspace is laid out this way.........
Re: Project Structure matching Filesystem Structure [message #1797583 is a reply to message #1797571] Fri, 02 November 2018 06:23 Go to previous messageGo to next message
Eclipse UserFriend
I explained that the structure you have does not map well the the structure of the workspace model. So your structure is fine, but is not a good match for the workspace model.

Note the project name by default is just the folder name. But you can choose any arbitrary name (Rename the project in the workspace via the context menu) that is different from the folder name; that name is stored in <actual-project-folder>/.project. If you commit that to your repository, the name will be remembered. So you could use qualified names so that sorting will order them more sensibly and so that your subproject hierarchy is evident from the name. It's the best you can do given the limitations.

A common practice, at least when developing plugins, is to use fully qualified names for the projects. E.g., org.eclipse.emf.ecore. And to use working sets to create logical groups of projects...
Re: Project Structure matching Filesystem Structure [message #1798193 is a reply to message #1797583] Tue, 13 November 2018 22:38 Go to previous messageGo to next message
Eclipse UserFriend
Does anybody have any idea if there is any way to do this?

Note that this is not *my* structure.....this is an existing open source project that I am looking to contribute to but Eclipse is making it very difficult because it won't allow me to use the filesystem's organization structure in the workspace. I have basically totally abandoned it at this point and am just using notepad++.........which is a shame because Eclipse has a lot of great features but I just can't use them.
Re: Project Structure matching Filesystem Structure [message #1798195 is a reply to message #1798193] Wed, 14 November 2018 00:44 Go to previous messageGo to next message
Eclipse UserFriend
I already explained that Eclipse's workspace cannot and will not show projects in a nested project structure. You won't get a different answer.

I also explained that you can change the project name. Select it and hit F2/Alt-Shift-R or from its context menu use Refactor -> Rename... (which shows the shortcut key for this operation). This way you can give projects a longer hierarchical name that reflects better your desired nesting structure.

You can use the Package Explorer view menu to change Top Level Elements -> Working Sets and use Configure Working Sets... to create one additional level of hierarchy to further group your projects.

More complicated but also possible is to hide folders from the workspace "view" of each project so that a project's nested project folders aren't duplicated in the workspace. From the project's context menu, use Properties... and use Resource -> Resource Filters -> Add Filter... and use that to exclude the folder(s) of the nested projects.

The information about the logical project names and the resource filters are stored in the .project file of each project, so you will only ever have to add/configure this information once; thereafter you can use import the projects and that information will already be there.
Re: Project Structure matching Filesystem Structure [message #1798290 is a reply to message #1798195] Wed, 14 November 2018 19:37 Go to previous message
Eclipse UserFriend
Thanks Ed, those workarounds are a big help, I'm able to get it to look somewhat how I'd like it to look now.
Previous Topic:Moderated posts
Next Topic:where to report this bug in eclipse 4.9
Goto Forum:
  


Current Time: Sun Jul 27 09:35:47 EDT 2025

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

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

Back to the top