Grails
  1. Grails
  2. GRAILS-8781

create-* scripts fail when trying to create unit tests

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Blocker Blocker
    • Resolution: Won't Fix
    • Affects Version/s: 2.0.1
    • Fix Version/s: 2.0.2
    • Component/s: None
    • Labels:
      None
    • Environment:
      Windows 7 x64

      Description

      See the discussion here: http://grails.1312388.n4.nabble.com/Grails-2-0-1-create-service-command-results-in-error-tp4391153p4391702.html

      Here's the error:

      | Loading Grails 2.0.1
      | Configuring classpath
      | Configuring classpath.
      | Environment set to development
      | Environment set to development.
      | Environment set to development..
      | Environment set to development...
      | Environment set to development....
      | Environment set to development.....
      | Created file grails-app/services/com/mycompany/mypackage/MyClassService.groovy
      | Error Error executing script CreateService: java.io.FileNotFoundException: /Users/deandelponte/grails/grails-2.0.1/grails-resources/src/grails/templates/artifacts/UnitTest.groovy (No such file or directory) (Use --stacktrace to see the full trace)
      

      Notice the grails-resources directory in there, if you remove that then the directory path is valid. I'm on Windows and running into this issue, but the first person to report it looks like they were on Mac/Linux of some kind.

        Activity

        Brian Saville created issue -
        Graeme Rocher made changes -
        Field Original Value New Value
        Fix Version/s 2.0.2 [ 13064 ]
        Priority Major [ 3 ] Blocker [ 1 ]
        Hide
        Hideki IGARASHI added a comment -

        For now can be avoided by removing the "~/.grails" directory.

        Show
        Hideki IGARASHI added a comment - For now can be avoided by removing the "~/.grails" directory.
        Hide
        Graeme Rocher added a comment -

        I'm not able to reproduce this. This would happen if the grails-resources-2.0.1.jar was not on the class path.

        Show
        Graeme Rocher added a comment - I'm not able to reproduce this. This would happen if the grails-resources-2.0.1.jar was not on the class path.
        Hide
        Samuel Doyle added a comment -

        I've seen this with the Spock plugin installed, appears there is some configuration conflict although I'm not sure on the particulars.

        Show
        Samuel Doyle added a comment - I've seen this with the Spock plugin installed, appears there is some configuration conflict although I'm not sure on the particulars.
        Hide
        Graeme Rocher added a comment -

        if someone can attach a reproducible example then we can take a look, atm we are unable to reproduce

        Show
        Graeme Rocher added a comment - if someone can attach a reproducible example then we can take a look, atm we are unable to reproduce
        Hide
        Jaroslav Kostal added a comment -

        Reproducible in Win7-x64, 1.6.0_25, Grails 2.0.1

        grails create-app example
        cd example
        grails install-plugin spock 0.6-SNAPSHOT
        grails refresh-dependencies
        grails create-domain-class Example
        
        Show
        Jaroslav Kostal added a comment - Reproducible in Win7-x64, 1.6.0_25, Grails 2.0.1 grails create-app example cd example grails install-plugin spock 0.6-SNAPSHOT grails refresh-dependencies grails create-domain-class Example
        Hide
        Jaroslav Kostal added a comment -

        Actually I have the same problem also in Grails 2.0.0, so I guess problem might be introduced by the latest spock snapshot

        Show
        Jaroslav Kostal added a comment - Actually I have the same problem also in Grails 2.0.0, so I guess problem might be introduced by the latest spock snapshot
        Hide
        John Cartwright added a comment -

        I can reproduce the problem on Mac 10.6.8/Grails 2.0.1. It seems to be related to the spock plugin. Works fine prior to installation of plugin; fails immediately after installation of plugin. Creating a new project w/o the spock plugin allows the test to be created.

        Removing the .grails/2.0.1/projects/<project> directory fixes the problem but only until the dependencies are refreshed.

        Show
        John Cartwright added a comment - I can reproduce the problem on Mac 10.6.8/Grails 2.0.1. It seems to be related to the spock plugin. Works fine prior to installation of plugin; fails immediately after installation of plugin. Creating a new project w/o the spock plugin allows the test to be created. Removing the .grails/2.0.1/projects/<project> directory fixes the problem but only until the dependencies are refreshed.
        Hide
        Brian Saville added a comment -

        According to Luke Daley, this is fixed in the latest snapshot of the spock plugin.

        Show
        Brian Saville added a comment - According to Luke Daley, this is fixed in the latest snapshot of the spock plugin.
        Hide
        Jeff Scott Brown added a comment -

        I cannot reproduce this with the latest 0.6 snapshot of the spock plugin.

        Brian, Can you confirm that you see the same?

        Show
        Jeff Scott Brown added a comment - I cannot reproduce this with the latest 0.6 snapshot of the spock plugin. Brian, Can you confirm that you see the same?
        Jeff Scott Brown made changes -
        Assignee Jeff Brown [ brownj ]
        Hide
        Jaroslav Kostal added a comment -

        I can confirm that with the latest spock-0.6-SNAPSHOT (2012-02-28) problem is solved.
        However I had to manually delete old spock-0.6-SNAPSHOT.zip (2012-02-12) from ivy cache...

        Show
        Jaroslav Kostal added a comment - I can confirm that with the latest spock-0.6-SNAPSHOT (2012-02-28) problem is solved. However I had to manually delete old spock-0.6-SNAPSHOT.zip (2012-02-12) from ivy cache...
        Hide
        Graeme Rocher added a comment -

        closing, as the issue was in the spock plugin

        Show
        Graeme Rocher added a comment - closing, as the issue was in the spock plugin
        Graeme Rocher made changes -
        Status Open [ 1 ] Closed [ 6 ]
        Resolution Won't Fix [ 2 ]

          People

          • Assignee:
            Jeff Scott Brown
            Reporter:
            Brian Saville
          • Votes:
            9 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development