I have a Grails application stored in a SVN repository. I want to add the Eclipse .project and .classpath files to the repository to make it easier for team members to checkout the project in STS and get started. The problem is that all of the Grails plugins used by the application are added to the application as Linked Resources with hard-coded paths in the .project file. This makes the file not very useful to share with a team.
I am currently working around the problem by hand editing the .project file to replace references like this:
In other words, I have created a Linked Resource variable named GRAILS that I can locally point to my home folder and other developers can do the same. Is there any better way to do this? A problem is that whenever a new plugin is added and dependencies are refreshed the hard-coded paths will be written to the file for the new plugin.
Even if this is the best way, couldn't a singled linked resource be added that points to the project plug-ins folder? Then there would only be one entry in the .project file and it would not need to be modified when plugins are refreshed.
The entries in .classpath are not hard coded but they clearly work with the ones in .project. Not sure if they would have problems if there was only a single linked resource. I do not think there would be a problem.
For example, suppose the .project file was changed to have a single entry like this:
So this links to the plugins folder for the application. In the .classpath file, couldn't you now have entries like this?
<classpathentry kind="src" path="grails-plugins/acegi-0.5.1/src/groovy">
<attribute name="com.springsource.sts.grails.core.SOURCE_FOLD ER" value="true"/>
This seems cleaner because now only the .classpath file needs to be modified when new dependencies are added, and the only hard-coding is in the .project file and this can be replaced by a variable.