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

Creating a wrapper addon causes exception in Roo shell

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Complete
    • Affects Version/s: 1.2.0.RC1
    • Fix Version/s: 1.2.0.RC1
    • Component/s: None
    • Labels:
      None

      Description

      Create a wrapper addon, e.g. as follows:

      addon create wrapper --groupId commons-lang --artifactId commons-lang --version 2.5 --topLevelPackage org.apache --vendorName Apache --licenseUrl http://www.apache.org

      The Roo shell throws this error:

      Invalid artifactId '${project.groupId}.${pkgArtifactId}'
      java.lang.IllegalArgumentException: Invalid artifactId '${project.groupId}.${pkgArtifactId}'
          at org.springframework.roo.support.util.Assert.isTrue(Assert.java:65)
          at org.springframework.roo.project.GAV.<init>(GAV.java:46)
          at org.springframework.roo.project.maven.Pom.<init>(Pom.java:88)
          at org.springframework.roo.project.maven.PomFactoryImpl.getInstance(PomFactoryImpl.java:75)
          at org.springframework.roo.project.PomManagementServiceImpl.parseUnparsedPoms(PomManagementServiceImpl.java:166)
          at org.springframework.roo.project.PomManagementServiceImpl.updatePomCache(PomManagementServiceImpl.java:140)
          at org.springframework.roo.project.PomManagementServiceImpl.getFocusedModule(PomManagementServiceImpl.java:111)
          at org.springframework.roo.project.PomManagementServiceImpl.getFocusedModuleName(PomManagementServiceImpl.java:119)
          at org.springframework.roo.project.AbstractProjectOperations.getFocusedModuleName(AbstractProjectOperations.java:149)
          at org.springframework.roo.project.AbstractProjectOperations.isFocusedProjectAvailable(AbstractProjectOperations.java:129)
          at org.springframework.roo.addon.dbre.model.DbreModelServiceImpl.getDbreXmlPath(DbreModelServiceImpl.java:119)
          at org.springframework.roo.addon.dbre.DbreDatabaseListenerImpl.onFileEvent(DbreDatabaseListenerImpl.java:89)
          at org.springframework.roo.file.monitor.polling.PollingFileMonitorService.publish(PollingFileMonitorService.java:352)
          at org.springframework.roo.file.monitor.polling.PollingFileMonitorService.publishRequestedFileEvents(PollingFileMonitorService.java:175)
          at org.springframework.roo.file.monitor.polling.PollingFileMonitorService.scanNotified(PollingFileMonitorService.java:150)
          at org.springframework.roo.process.manager.internal.DefaultProcessManager.doTransactionally(DefaultProcessManager.java:192)
          at org.springframework.roo.process.manager.internal.DefaultProcessManager.execute(DefaultProcessManager.java:146)
          at org.springframework.roo.process.manager.ProcessManagerHostedExecutionStrategy.execute(ProcessManagerHostedExecutionStrategy.java:47)
          at org.springframework.roo.shell.AbstractShell.executeCommand(AbstractShell.java:204)
          at org.springframework.roo.shell.jline.JLineShell.promptLoop(JLineShell.java:403)
          at org.springframework.roo.shell.jline.JLineShell.run(JLineShell.java:158)

      Note that the generated addon project is valid and can be built by Maven, but with warnings:

      aswan: addon > mvn clean install
      [INFO] Scanning for projects...
      [WARNING] 
      [WARNING] Some problems were encountered while building the effective model for org.apache:org.apache.commons-lang:bundle:2.5.0001
      [WARNING] 'artifactId' contains an expression but should be a constant. @ org.apache:${project.groupId}.${pkgArtifactId}:${osgiVersion}, /Users/aswan/projects/addon/pom.xml, line 5, column 17
      [WARNING] 'version' contains an expression but should be a constant. @ org.apache:${project.groupId}.${pkgArtifactId}:${osgiVersion}, /Users/aswan/projects/addon/pom.xml, line 7, column 14
      [WARNING] 
      [WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
      [WARNING] 
      [WARNING] For this reason, future Maven versions might no longer support building such malformed projects.

      The solution to both the Roo shell error and the Maven warning is to change the generated POM not to use expressions in either the "artifactId" or "version" elements.

        Attachments

          Activity

            People

            Assignee:
            aswan Andrew Swan
            Reporter:
            aswan Andrew Swan
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: