views:

962

answers:

4

What parts of a Grails application need to be stored in source-control? Some obvious parts that are needed:

  • grails-app directory
  • test directory
  • web-app directory

Now we reach questions like:

  • If we use a Grails plug-in (like gldapo), do we need to check in that plugin?
  • Do Grails plugins install in the Grails directory, or your project?

I'm not looking to start a religious war about .project, so please ignore that, but are there any "hidden" project files I need to worry about, along with the plugin issues?

Converted to a community wiki, as new versions of Grails have changed some of these solutions, especially as regards plugins.

+1  A: 

I would say, put all your project directory under versionning. Even the libs, it won't take that much disk space and you'll not change them so often.

To my point of view, it's somehow "safer" than relying on external tools such as maven to grab all the dependencies, especially when one of the dependecies silently upgrade and change a little bit its behaviour, introducing "bugs" in your own project.

gizmo
Thanks, though you can set what version of a library to get in the Maven pom. I take your point about checking in everything.
Bill James
Sure you can, but I had the problem in a previous company where the local maintainer changed the internal version of your maven rep without adding new directories. It's a shame, but shit happens, sometimes.
gizmo
And sometimes the plugins itself has bugs that you need to fix it yourself. If the plugins are separated then each new setup will mean patching the plugins.
Seymour Cakes
+1  A: 

After a bit more research, it seems that plugins for Grails are installed in the project directory, they don't change your Grails install. This means you'll need to install that plugin in each Grails project you want to use the functionality, and that the plugin is part of each project's source code.

These plugins are installed in the grails-app/plugins directory, so if you're already checking in the grails-app directory, all should be well.

There don't seem to be any "hidden files" that need checking in, though there are a few empty directories created when starting a new project that should be added to the source-control, as you'll probably add files to them at a later date.

Bill James
+6  A: 
  • You do not want ./plugins/core (Core Grails plugins) under SVN
  • You do not want anything under ./web-app/WEB-INF/ under SVN. You should not usually need to put files in here. Files from ./conf are copied to WEB-INF/classes so they are on the classpath, if you need to supply anything.

Here's a link to the docs describing in more detail.

mbrevoort
Got anything on hg? http://stackoverflow.com/questions/2582121/best-practices-for-using-hg-with-grails
leeand00
A: 

There is a tutorial on the Grails.org site for subversion.

http://www.grails.org/Checking+Projects+into+SVN
It doesn't appear to be up-to-date with Grails 1.1
Don