Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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] Thu, 01 November 2018 01:09 Go to next message
Alex Adams is currently offline Alex AdamsFriend
Messages: 2
Registered: November 2018
Junior Member
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: Thu, 01 November 2018 02:01]

Report message to a moderator

Re: Project Structure matching Filesystem Structure [message #1797524 is a reply to message #1797511] Thu, 01 November 2018 06:48 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 29649
Registered: July 2009
Senior Member
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 22:30 Go to previous messageGo to next message
Alex Adams is currently offline Alex AdamsFriend
Messages: 2
Registered: November 2018
Junior Member
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 10:23 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 29649
Registered: July 2009
Senior Member
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...
Previous Topic:Photon update problem
Next Topic:STS plugin and WIN 10
Goto Forum:
  


Current Time: Tue Nov 13 18:35:38 GMT 2018

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

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

Back to the top