Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Blocker Blocker
    • Resolution: Fixed
    • Affects Version/s: 1.0-rc-3
    • Fix Version/s: 1.0-rc-5
    • Component/s: stub generation
    • Labels:
      None
    • Environment:
      1.0 rc3 with Groovy 1.5 runtime
    • Number of attachments :
      1

      Description

      Stub generation fails for groovy scripts (that have no class body defined in the groovy file). Two examples are included with different errors for each.

      Script TestScript.groovy:

      println "success"

      This script generates a stub that does not comple. Here is the error:

      E:\projects\core\target\generated-sources\groovy-stubs\test\TestScript.java:[31,33] modifier transient not all
      wed here

      E:\projects\core\target\generated-sources\groovy-stubs\test\TestScript.java:[14,7] TestScript is not abstract
      nd does not override abstract method run() in groovy.lang.Script

      [INFO] ------------------------------------------------------------------------
      [INFO] Trace
      org.apache.maven.BuildFailureException: Compilation failure
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:560)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:4
      0)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:459)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.ja
      a:311)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:278)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:143)
      at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:333)
      at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:126)
      at org.apache.maven.cli.MavenCli.main(MavenCli.java:282)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
      at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
      at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
      at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
      Caused by: org.apache.maven.plugin.CompilationFailureException: Compilation failure
      at org.apache.maven.plugin.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:516)
      at org.apache.maven.plugin.TestCompilerMojo.execute(TestCompilerMojo.java:102)
      at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:447)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:539)
      ... 16 more

      Script TestScriptMethod.groovy:

      def getValue () {
      return "success"
      }

      println getValue()

      This script does not generate a stub. This script results in the following error:

      org.apache.maven.lifecycle.LifecycleExecutionException
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:564)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:48
      0)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:459)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.jav
      a:311)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:278)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:143)
      at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:333)
      at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:126)
      at org.apache.maven.cli.MavenCli.main(MavenCli.java:282)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
      at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
      at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
      at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
      Caused by: org.apache.maven.plugin.MojoExecutionException
      at org.codehaus.groovy.maven.plugin.MojoSupport.execute(MojoSupport.java:85)
      at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:447)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:539)
      ... 16 more
      Caused by: java.lang.NullPointerException
      at org.codehaus.groovy.maven.runtime.support.stubgen.model.ModelFactorySupport.methodDef(ModelFactorySupport.jav
      a:469)
      at org.codehaus.groovy.maven.runtime.support.stubgen.model.ModelFactorySupport.process(ModelFactorySupport.java:
      126)
      at org.codehaus.groovy.maven.runtime.support.stubgen.model.ModelFactorySupport.create(ModelFactorySupport.java:8
      4)
      at org.codehaus.groovy.maven.runtime.v15.StubCompilerFeature$StubCompilerImpl.render(StubCompilerFeature.java:10
      3)
      at org.codehaus.groovy.maven.runtime.v15.StubCompilerFeature$StubCompilerImpl.compile(StubCompilerFeature.java:9
      2)
      at org.codehaus.groovy.maven.plugin.stubgen.AbstractGenerateStubsMojo.compile(AbstractGenerateStubsMojo.java:97)

      at org.codehaus.groovy.maven.plugin.stubgen.AbstractGenerateStubsMojo.process(AbstractGenerateStubsMojo.java:68)

      at org.codehaus.groovy.maven.plugin.ComponentMojoSupport.doExecute(ComponentMojoSupport.java:68)
      at org.codehaus.groovy.maven.plugin.MojoSupport.execute(MojoSupport.java:69)
      ... 18 more

      The scripts and stub output are included as attachments.

        Activity

        Hide
        Jason Dillon added a comment -

        Its clear I've not actually tested this, no idea why transient is in there, also looks like run() was never stubbed out either.

        Show
        Jason Dillon added a comment - Its clear I've not actually tested this, no idea why transient is in there, also looks like run() was never stubbed out either.

          People

          • Assignee:
            Jason Dillon
            Reporter:
            Chris Dail
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: