java.lang.IllegalArgumentException: Invalid artifactId '${project.groupId}.${pkgArtifactId}'

Spring JIRA | Andrew Swan | 5 years ago
tip
Do you know that we can give you better hits? Get more relevant results from Samebug’s stack trace search.
  1. 0

    Create a wrapper addon, e.g. as follows: {code}addon create wrapper --groupId commons-lang --artifactId commons-lang --version 2.5 --topLevelPackage org.apache --vendorName Apache --licenseUrl http://www.apache.org{code} The Roo shell throws this error: {code}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){code} Note that the generated addon project is valid and can be built by Maven, but with warnings: {code}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.{code} 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.

    Spring JIRA | 5 years ago | Andrew Swan
    java.lang.IllegalArgumentException: Invalid artifactId '${project.groupId}.${pkgArtifactId}'
  2. 0

    Create a wrapper addon, e.g. as follows: {code}addon create wrapper --groupId commons-lang --artifactId commons-lang --version 2.5 --topLevelPackage org.apache --vendorName Apache --licenseUrl http://www.apache.org{code} The Roo shell throws this error: {code}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){code} Note that the generated addon project is valid and can be built by Maven, but with warnings: {code}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.{code} 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.

    Spring JIRA | 5 years ago | Andrew Swan
    java.lang.IllegalArgumentException: Invalid artifactId '${project.groupId}.${pkgArtifactId}'

    Root Cause Analysis

    1. java.lang.IllegalArgumentException

      Invalid artifactId '${project.groupId}.${pkgArtifactId}'

      at org.springframework.roo.support.util.Assert.isTrue()
    2. org.springframework.roo
      DbreModelServiceImpl.getDbreXmlPath
      1. org.springframework.roo.support.util.Assert.isTrue(Assert.java:65)
      2. org.springframework.roo.project.GAV.<init>(GAV.java:46)
      3. org.springframework.roo.project.maven.Pom.<init>(Pom.java:88)
      4. org.springframework.roo.project.maven.PomFactoryImpl.getInstance(PomFactoryImpl.java:75)
      5. org.springframework.roo.project.PomManagementServiceImpl.parseUnparsedPoms(PomManagementServiceImpl.java:166)
      6. org.springframework.roo.project.PomManagementServiceImpl.updatePomCache(PomManagementServiceImpl.java:140)
      7. org.springframework.roo.project.PomManagementServiceImpl.getFocusedModule(PomManagementServiceImpl.java:111)
      8. org.springframework.roo.project.PomManagementServiceImpl.getFocusedModuleName(PomManagementServiceImpl.java:119)
      9. org.springframework.roo.project.AbstractProjectOperations.getFocusedModuleName(AbstractProjectOperations.java:149)
      10. org.springframework.roo.project.AbstractProjectOperations.isFocusedProjectAvailable(AbstractProjectOperations.java:129)
      11. org.springframework.roo.addon.dbre.model.DbreModelServiceImpl.getDbreXmlPath(DbreModelServiceImpl.java:119)
      11 frames
    3. Spring Roo - Annotations (ASLv2 Licensed)
      DbreDatabaseListenerImpl.onFileEvent
      1. org.springframework.roo.addon.dbre.DbreDatabaseListenerImpl.onFileEvent(DbreDatabaseListenerImpl.java:89)
      1 frame
    4. org.springframework.roo
      JLineShell.promptLoop
      1. org.springframework.roo.file.monitor.polling.PollingFileMonitorService.publish(PollingFileMonitorService.java:352)
      2. org.springframework.roo.file.monitor.polling.PollingFileMonitorService.publishRequestedFileEvents(PollingFileMonitorService.java:175)
      3. org.springframework.roo.file.monitor.polling.PollingFileMonitorService.scanNotified(PollingFileMonitorService.java:150)
      4. org.springframework.roo.process.manager.internal.DefaultProcessManager.doTransactionally(DefaultProcessManager.java:192)
      5. org.springframework.roo.process.manager.internal.DefaultProcessManager.execute(DefaultProcessManager.java:146)
      6. org.springframework.roo.process.manager.ProcessManagerHostedExecutionStrategy.execute(ProcessManagerHostedExecutionStrategy.java:47)
      7. org.springframework.roo.shell.AbstractShell.executeCommand(AbstractShell.java:204)
      8. org.springframework.roo.shell.jline.JLineShell.promptLoop(JLineShell.java:403)
      8 frames