Grails
  1. Grails
  2. GRAILS-8175

Running "grails clean" should provide a totally clean environment to run the app

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Blocker Blocker
    • Resolution: Fixed
    • Affects Version/s: 1.3.7, 2.0-RC1
    • Fix Version/s: 2.3-RC1
    • Component/s: None
    • Labels:
      None

      Description

      Running "grails clean" does not delete all files that affect the build of an app, and this seems counter-intuitive.

      e.g. a custom BuildConfig with:

      grails.project.work.dir="target/work"
      

      Means that you cannot reliably switch between grails versions on a code base (e.g. using git local branches) as the work directory is polluted and "clean" does not clear it.

      I think clean should mean clean.

        Activity

        Hide
        Antony Jones added a comment -

        Absolutely the bane of our lives, especially on our CI boxes.

        grails clean should delete ~/.grails/x.x.x/projects/* as well, as the amount of times 'rm -rf'ing this directory makes our tests pass is infuriating.

        Show
        Antony Jones added a comment - Absolutely the bane of our lives, especially on our CI boxes. grails clean should delete ~/.grails/x.x.x/projects/* as well, as the amount of times 'rm -rf'ing this directory makes our tests pass is infuriating.
        Hide
        Lloyd Jones added a comment -

        In grails 2.0 We are also finding issues relating to clean before creating wars. We use eventCreateWarStart to append subversion revision to the war name during the build. Previously clean would remove the war from target so the new war is the only one present in target. Now the war is left and not overwritten (since its name is different) so we end up with multiple wars in target. Its not a major issue as we can manually remove old wars in eventCreateWarStart beforehand.

        Maybe a super powerful clean-all command would allow the clean of all required directories

        A more granular suggestion would be the ability to specify what is cleaned:

        • -custom : would remove folders used by custom build config
        • -war : would remove the war
        • -project : would remove project folders from the /.grails/2.0.0/projects/myRandomProject/*
        Show
        Lloyd Jones added a comment - In grails 2.0 We are also finding issues relating to clean before creating wars. We use eventCreateWarStart to append subversion revision to the war name during the build. Previously clean would remove the war from target so the new war is the only one present in target. Now the war is left and not overwritten (since its name is different) so we end up with multiple wars in target. Its not a major issue as we can manually remove old wars in eventCreateWarStart beforehand. Maybe a super powerful clean-all command would allow the clean of all required directories A more granular suggestion would be the ability to specify what is cleaned: -custom : would remove folders used by custom build config -war : would remove the war -project : would remove project folders from the /.grails/2.0.0/projects/myRandomProject/*
        Hide
        Fred Janon added a comment -

        As of 2.2.2 2013-05-27, "grails clean" still leaves a lot of .class files in target\work\plugin-classes. It takes too long to go cleanup by hand and the "grails clean" command is still the magic wand to solve some issues sometime. It would be good to know it is really cleaning up. This issue has been up since 1.3.7, is there any chance to see it fixed? Is it a major issue to fix? I am not sure why it would be so difficult to fix it, especially in Groovy.

        "stacktrace.log" is also not deleted and sometimes it's quite big.

        Env: 2.2.2, Win7

        Show
        Fred Janon added a comment - As of 2.2.2 2013-05-27, "grails clean" still leaves a lot of .class files in target\work\plugin-classes. It takes too long to go cleanup by hand and the "grails clean" command is still the magic wand to solve some issues sometime. It would be good to know it is really cleaning up. This issue has been up since 1.3.7, is there any chance to see it fixed? Is it a major issue to fix? I am not sure why it would be so difficult to fix it, especially in Groovy. "stacktrace.log" is also not deleted and sometimes it's quite big. Env: 2.2.2, Win7
        Hide
        Travis Webb added a comment -

        "grails clean" is just as useless in 2.3-RC1 as it always has been. Why is this marked fixed?

        Show
        Travis Webb added a comment - "grails clean" is just as useless in 2.3-RC1 as it always has been. Why is this marked fixed?
        Hide
        Burt Beckwith added a comment -

        Thanks for the constructive and polite feedback. If you look in the Git Commits tab you'll see that there's a new "clean-all" script that does the same work as "clean", but also deletes the test report, script cache, and plugin build class directories.

        Show
        Burt Beckwith added a comment - Thanks for the constructive and polite feedback. If you look in the Git Commits tab you'll see that there's a new "clean-all" script that does the same work as "clean", but also deletes the test report, script cache, and plugin build class directories.
        Hide
        Travis Webb added a comment -

        Thanks @Burt. I sometimes forget that documentation for pre-released software is in a different place

        Show
        Travis Webb added a comment - Thanks @Burt. I sometimes forget that documentation for pre-released software is in a different place
        Hide
        Travis Webb added a comment -

        If I run "clean-all" and then run "url-mappings-report", the report is still stale. I have to `rm -rf target/` in order to make it work.

        Show
        Travis Webb added a comment - If I run "clean-all" and then run "url-mappings-report", the report is still stale. I have to `rm -rf target/` in order to make it work.
        Hide
        Svetozar Misljencevic added a comment -

        Would it be possible to replace the "clean" command with "clean-all"? I think that everyone expects that clean will remove all caches, temporary files etc...

        Show
        Svetozar Misljencevic added a comment - Would it be possible to replace the "clean" command with "clean-all"? I think that everyone expects that clean will remove all caches, temporary files etc...

          People

          • Assignee:
            Graeme Rocher
            Reporter:
            Marc Palmer
          • Votes:
            17 Vote for this issue
            Watchers:
            13 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:
              Last Reviewed:

              Development