How can a team share an eclipse project when their work environment is different?

When sharing a project with team members using version control, a .project is usually included in the source under version control. This ensures that others in the team get all the dependencies and resources for the project. But .project uses the full / root paths to the resource, and not all team members will work in the same environment. Even if all participants are on the same platform, paths can often be in the user's home directory.

For the .classpath file, we can work around this problem using build path variables. Each member defines a path to the location of dependent libraries in its system, and .classpath refers only to a variable.

This is a particular problem for the Grails project - when we add a plugin, it updates the .project accordingly.

+3
source share
5 answers

General approach

As mentioned above, you should not store IDE files in VCS, you should save the IDN agnostic description of the project in VCS and generate IDE project files from it.


Java Maven Example

Save the pom.xml files to VCS and generate the Eclipse files by running mvn eclipse:eclipse


Grails example

The Grails project is described application.propertiesand grails-app/conf/BuildConfig.groovy. These files are present in every Grails application. You can generate Eclipse project descriptions from them by doing:

grails integrate-with --eclipse

This command also supports other tools such as IntelliJ and Textmate.

+1
source

. m2eclipse, , Maven. . , , , - (pom.xml) - , . - :)

UPDATE: grails . Groovy - Maven Gradle. STS, , Eclipse , Groovy. STS Gradle .

+3

, . VCS IDE VCS . README, , (, lib)

+1

, , . "" → "" → " " → .

+1

You can try to save the project files in a general Dropbox with an agreed path for each developer.

-1
source

All Articles