Uploaded image for project: 'Spring Roo'
  1. Spring Roo
  2. ROO-3093

Failing to include surefire default-test execution goal causes Roo shell issues

    XMLWordPrintable

    Details

      Description

      In order to run both my TestNG & JUnit 4 tests, I configured surefire in the following way in my project's pom:
      <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-surefire-plugin</artifactId>
      <version>2.11</version>
      <executions>
      <execution>
      <id>default-test</id>
      <configuration>
      <skipTests>true</skipTests>
      </configuration>
      </execution>
      <execution>
      <id>junit-tests</id>
      <goals>
      <goal>test</goal>
      </goals>
      <configuration>
      <testNGArtifactName>none:none</testNGArtifactName>
      <printSummary>false</printSummary>
      <redirectTestOutputToFile>true</redirectTestOutputToFile>
      <excludes>
      <exclude>*/Roo*</exclude>
      </excludes>
      </configuration>
      </execution>
      <execution>
      <id>testng-tests</id>
      <goals>
      <goal>test</goal>
      </goals>
      <configuration>
      <junitArtifactName>none:none</junitArtifactName>
      <printSummary>false</printSummary>
      <redirectTestOutputToFile>true</redirectTestOutputToFile>
      <excludes>
      <exclude>*/Roo*</exclude>
      </excludes>
      </configuration>
      </execution>
      </executions>
      </plugin>

      Then, after running roo.sh (with development.mode=true), I get the following shell behavior:

      ____ ____ ____
      / __ \/ __ \/ __ \
      / /_/ / / / / / / /
      / , _/ // / /_/ /
      // ||___/___/ 1.2.1.RELEASE [rev 6eae723]

      Welcome to Spring Roo. For assistance press TAB or type "hint" then hit ENTER.
      [FelixDispatchQueue] at least one goal must be specified
      java.lang.IllegalArgumentException: at least one goal must be specified
      at org.apache.commons.lang3.Validate.notEmpty(Validate.java:251)
      at org.springframework.roo.project.Execution.<init>(Execution.java:48)
      at org.springframework.roo.project.Plugin.getExecutions(Plugin.java:137)
      at org.springframework.roo.project.Plugin.<init>(Plugin.java:182)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
      at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
      at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
      at org.springframework.roo.project.maven.PomFactoryImpl.parseElements(PomFactoryImpl.java:164)
      at org.springframework.roo.project.maven.PomFactoryImpl.getInstance(PomFactoryImpl.java:90)
      at org.springframework.roo.project.PomManagementServiceImpl.parseUnparsedPoms(PomManagementServiceImpl.java:206)
      at org.springframework.roo.project.PomManagementServiceImpl.updatePomCache(PomManagementServiceImpl.java:336)
      at org.springframework.roo.project.PomManagementServiceImpl.getModuleForFileIdentifier(PomManagementServiceImpl.java:123)
      at org.springframework.roo.project.AbstractProjectOperations.getModuleForFileIdentifier(AbstractProjectOperations.java:510)
      at org.springframework.roo.classpath.TypeLocationServiceImpl.getProposedJavaType(TypeLocationServiceImpl.java:342)
      at org.springframework.roo.classpath.TypeLocationServiceImpl.doesPathIndicateJavaType(TypeLocationServiceImpl.java:112)
      at org.springframework.roo.classpath.TypeLocationServiceImpl.getPhysicalTypeIdentifier(TypeLocationServiceImpl.java:248)
      at org.springframework.roo.classpath.DefaultPhysicalTypeMetadataProvider.onFileEvent(DefaultPhysicalTypeMetadataProvider.java:176)
      at org.springframework.roo.file.monitor.polling.PollingFileMonitorService.publish(PollingFileMonitorService.java:429)
      at org.springframework.roo.file.monitor.polling.PollingFileMonitorService.scanAll(PollingFileMonitorService.java:642)
      at org.springframework.roo.process.manager.internal.MonitoringRequestCommand.callback(MonitoringRequestCommand.java:39)
      at org.springframework.roo.process.manager.internal.MonitoringRequestCommand.callback(MonitoringRequestCommand.java:15)
      at org.springframework.roo.process.manager.internal.DefaultProcessManager.doTransactionally(DefaultProcessManager.java:169)
      at org.springframework.roo.process.manager.internal.DefaultProcessManager.completeStartup(DefaultProcessManager.java:139)
      at org.springframework.roo.process.manager.internal.DefaultProcessManager.access$100(DefaultProcessManager.java:35)
      at org.springframework.roo.process.manager.internal.DefaultProcessManager$1.frameworkEvent(DefaultProcessManager.java:68)
      at org.apache.felix.framework.util.EventDispatcher.invokeFrameworkListenerCallback(EventDispatcher.java:774)
      at org.apache.felix.framework.util.EventDispatcher.fireEventImmediately(EventDispatcher.java:725)
      at org.apache.felix.framework.util.EventDispatcher.run(EventDispatcher.java:949)
      at org.apache.felix.framework.util.EventDispatcher.access$000(EventDispatcher.java:54)
      at org.apache.felix.framework.util.EventDispatcher$1.run(EventDispatcher.java:106)
      at java.lang.Thread.run(Thread.java:662)
      roo> hint
      at least one goal must be specified
      java.lang.IllegalArgumentException: at least one goal must be specified
      at org.apache.commons.lang3.Validate.notEmpty(Validate.java:251)
      at org.springframework.roo.project.Execution.<init>(Execution.java:48)
      at org.springframework.roo.project.Plugin.getExecutions(Plugin.java:137)
      at org.springframework.roo.project.Plugin.<init>(Plugin.java:182)
      at sun.reflect.GeneratedConstructorAccessor11.newInstance(Unknown Source)
      at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
      at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
      at org.springframework.roo.project.maven.PomFactoryImpl.parseElements(PomFactoryImpl.java:164)
      at org.springframework.roo.project.maven.PomFactoryImpl.getInstance(PomFactoryImpl.java:90)
      at org.springframework.roo.project.PomManagementServiceImpl.parseUnparsedPoms(PomManagementServiceImpl.java:206)
      at org.springframework.roo.project.PomManagementServiceImpl.updatePomCache(PomManagementServiceImpl.java:336)
      at org.springframework.roo.project.PomManagementServiceImpl.getFocusedModule(PomManagementServiceImpl.java:108)
      at org.springframework.roo.project.PomManagementServiceImpl.getFocusedModuleName(PomManagementServiceImpl.java:116)
      at org.springframework.roo.project.AbstractProjectOperations.getFocusedModuleName(AbstractProjectOperations.java:494)
      at org.springframework.roo.project.AbstractProjectOperations.isFocusedProjectAvailable(AbstractProjectOperations.java:595)
      at org.springframework.roo.classpath.operations.HintOperationsImpl.determineTopic(HintOperationsImpl.java:49)
      at org.springframework.roo.classpath.operations.HintOperationsImpl.hint(HintOperationsImpl.java:101)
      at org.springframework.roo.classpath.operations.HintCommands.hint(HintCommands.java:26)
      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.springframework.roo.process.manager.ProcessManagerHostedExecutionStrategy$1.callback(ProcessManagerHostedExecutionStrategy.java:46)
      at org.springframework.roo.process.manager.internal.DefaultProcessManager.doTransactionally(DefaultProcessManager.java:169)
      at org.springframework.roo.process.manager.internal.DefaultProcessManager.execute(DefaultProcessManager.java:226)
      at org.springframework.roo.process.manager.ProcessManagerHostedExecutionStrategy.execute(ProcessManagerHostedExecutionStrategy.java:43)
      at org.springframework.roo.shell.AbstractShell.executeCommandImpl(AbstractShell.java:225)
      at org.springframework.roo.shell.AbstractShell.executeCommand(AbstractShell.java:135)
      at org.springframework.roo.shell.jline.JLineShell.promptLoop(JLineShell.java:420)
      at org.springframework.roo.shell.jline.JLineShell.run(JLineShell.java:538)
      at java.lang.Thread.run(Thread.java:662)

      If I then add <goals><goal>test</goal></goals> to the default-test surefire execution, everything works fine.

        Attachments

          Activity

            People

            Assignee:
            stewarta Alan Stewart
            Reporter:
            matthewadams Matthew T. Adams
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: