James Oravec
James Oravec

Reputation: 20391

Source Control Base Eclipse Configurations

Short Version:

Is there an easy way to source control a project configuration for eclipse? I'm okay with source controlling an export of configs that others can import when they first setup the project. So that when others roll on the project they don't have to do a ton of configurations to get this more complex project running.

Details:

1) Specifically for my main question, I'm working on a project that I had to get working that has submodules of sub modules, so I've had to right click on the project -> Configure -> Configure and Detect Nested Projects and import the submodules several times. After that on each module I had to right click -> Configure -> Convert to Maven Project. In addition to this, I had to set a lot of Derived folders so that searches were more meaningful in the IDE.

2) Lastly I think this is specific to the eclipse instance, however think there should be a way to export/import this as well. In order to get the project running, I have to setup a couple maven run/debug configurations that target jetty:run and pass like 4 params.

Ideally, I'd like it to be in a way that others can quickly clone the repo, import the configuration easily and be working with a baseline configuration, so that they don't have to be an eclipse expert to load the project and do simple things with it.

Upvotes: 0

Views: 78

Answers (2)

James Oravec
James Oravec

Reputation: 20391

Want to make a note here for others, in case they have a similar question. Props to Aleksandr who commented on this yesterday, which I didn't understand until today. This adds more detail on his comment.

My process I described in number 1 is not the proper process I should of followed. I was trying to do things the difficult way. Instead of opening the folder then trying to configured everything I should of instead did a File -> Import -> Existing Maven Project.

If you are in a similar state. Kill your folder, do the equivalent of re-cloning the git repo into a clean folder, then do the import as stated above.

The above detects the submodules from the parent pom file. This also helps everything display properly in the IDE. It will also handle the build and target folders properly, so avoid derived folder issues and much much more.

Upvotes: 1

ChrisThompson
ChrisThompson

Reputation: 2008

Everything you've described so far is contained between the .settings, .classpath and .project folder and files. you should be able to commit those file to your source repository and check them out as java projects. Even though this is against the typical Maven guidance. The classpath file will likely cause your project to have errors though if someone checks that file out without having run maven to actually download those dependencies to their local artifactory.

Upvotes: 1

Related Questions