Announcement Announcement Module
Collapse
No announcement yet.
Grails 2.0 and version control Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Grails 2.0 and version control

    Hi, my local JUG is learning Grails 2 and git and I was wondering what we need to add to the ignore list. All the existing advice looks to be for 1.x and relying on that sounds dangerous. For instance, they all say to ignore WEB-INF, but that contains applicationContext.xml (which doesn't exist elsewhere). Can someone tell me the definitive list of files to ignore? All I have so far are the Eclipse/STS files like .project and .classpath.

    Thanks,
    Philip

  • #2
    Run 'grails integrate-with --git' and it will create a .gitignore file for you. It probably has more entries than you need but has all the important ones.

    Comment


    • #3
      Thanks, Burt. Here is what it produced:

      *.iws
      *Db.properties
      *Db.script
      .settings
      stacktrace.log
      /*.zip
      /plugin.xml
      /*.log
      /*DB.*
      /cobertura.ser
      .DS_Store
      /target/
      /out/
      /web-app/plugins
      /web-app/WEB-INF/classes

      I believe I should add the following:

      /target-eclipse/
      .project
      .classpath

      Please let me know if you think that's off or needs more. I created the project with STS 2.9M2 and the Grails project wizard if that makes any difference.

      Comment


      • #4
        I change the STS classes directory to /target/eclipseclasses so everything ends up under target. But if you want to keep /target-eclipse/ then yes, add it.

        I check in the .project and .classpath files so others can clone the repo and open the project in STS. It will have some hard-coded paths (e.g. to plugin source directories) but others can run Grails | Refresh Dependencies and it'll update theirs. Or you can manually edit out those paths (e.g. <classpathentry kind="src" path=".link_to_grails_plugins..."> blocks in .classpath and the <linkedResources> block in .project and check in clean files that are usable by others (they still need to run Refresh Dependencies though).

        Comment


        • #5
          Thanks again, I will include .project and .classpath and instruct users to run Refresh Dependencies.

          I'll add I was initially confused after doing Team >> Add at the project level, as none of the files in .link_to_grails_plugins were being tracked. However, I found these resources:

          http://stackoverflow.com/questions/7...older-used-for
          http://help.eclipse.org/helios/index...oncepts-13.htm

          which explains it's an STS-specific artifact, linking to directories outside the project that shouldn't be checked in, hence it's ignored. Hope that helps the next person.

          Comment

          Working...
          X