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

Spring JIRA | Andrew Swan | 5 years ago
  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}'
  3. 0

    The first command to start a project fails. roo> script clinic.roo project --topLevelPackage com.springsource.petclinic Unable to obtain required element '/project/artifactId' from element '[project: null]' java.lang.IllegalArgumentException: Unable to obtain required element '/project/artifactId' from element '[project: null]' at org.springframework.roo.support.util.Assert.notNull(Assert.java:112) at org.springframework.roo.support.util.XmlUtils.findRequiredElement(XmlUtils.java:352) at org.springframework.roo.project.MavenOperationsImpl.createProject(MavenOperationsImpl.java:87) at org.springframework.roo.project.MavenCommands.createProject(MavenCommands.java:36) 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.support.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:191) at org.springframework.roo.process.manager.ProcessManagerHostedExecutionStrategy$1.callback(ProcessManagerHostedExecutionStrategy.java:49) at org.springframework.roo.process.manager.internal.DefaultProcessManager.doTransactionally(DefaultProcessManager.java:180) at org.springframework.roo.process.manager.internal.DefaultProcessManager.execute(DefaultProcessManager.java:143) at org.springframework.roo.process.manager.ProcessManagerHostedExecutionStrategy.execute(ProcessManagerHostedExecutionStrategy.java:47) at org.springframework.roo.shell.AbstractShell.executeCommand(AbstractShell.java:191) at org.springframework.roo.shell.AbstractShell.executeScriptLine(AbstractShell.java:131) at org.springframework.roo.shell.AbstractShell.script(AbstractShell.java:98) 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.support.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:191) at org.springframework.roo.process.manager.ProcessManagerHostedExecutionStrategy$1.callback(ProcessManagerHostedExecutionStrategy.java:49) at org.springframework.roo.process.manager.internal.DefaultProcessManager.doTransactionally(DefaultProcessManager.java:180) at org.springframework.roo.process.manager.internal.DefaultProcessManager.execute(DefaultProcessManager.java:143) at org.springframework.roo.process.manager.ProcessManagerHostedExecutionStrategy.execute(ProcessManagerHostedExecutionStrategy.java:47) at org.springframework.roo.shell.AbstractShell.executeCommand(AbstractShell.java:191) at org.springframework.roo.shell.jline.JLineShell.promptLoop(JLineShell.java:374) at org.springframework.roo.shell.jline.JLineShell.run(JLineShell.java:135) at java.lang.Thread.run(Thread.java:680) Script required 0 second(s) to execute Script execution aborted java.lang.IllegalStateException: Script execution aborted at org.springframework.roo.shell.AbstractShell.script(AbstractShell.java:103) 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.support.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:191) at org.springframework.roo.process.manager.ProcessManagerHostedExecutionStrategy$1.callback(ProcessManagerHostedExecutionStrategy.java:49) at org.springframework.roo.process.manager.internal.DefaultProcessManager.doTransactionally(DefaultProcessManager.java:180) at org.springframework.roo.process.manager.internal.DefaultProcessManager.execute(DefaultProcessManager.java:143) at org.springframework.roo.process.manager.ProcessManagerHostedExecutionStrategy.execute(ProcessManagerHostedExecutionStrategy.java:47) at org.springframework.roo.shell.AbstractShell.executeCommand(AbstractShell.java:191) at org.springframework.roo.shell.jline.JLineShell.promptLoop(JLineShell.java:374) at org.springframework.roo.shell.jline.JLineShell.run(JLineShell.java:135) at java.lang.Thread.run(Thread.java:680)

    Spring JIRA | 5 years ago | Dirk Joosen
    java.lang.IllegalArgumentException: Unable to obtain required element '/project/artifactId' from element '[project: null]'
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    The first command to start a project fails. roo> script clinic.roo project --topLevelPackage com.springsource.petclinic Unable to obtain required element '/project/artifactId' from element '[project: null]' java.lang.IllegalArgumentException: Unable to obtain required element '/project/artifactId' from element '[project: null]' at org.springframework.roo.support.util.Assert.notNull(Assert.java:112) at org.springframework.roo.support.util.XmlUtils.findRequiredElement(XmlUtils.java:352) at org.springframework.roo.project.MavenOperationsImpl.createProject(MavenOperationsImpl.java:87) at org.springframework.roo.project.MavenCommands.createProject(MavenCommands.java:36) 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.support.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:191) at org.springframework.roo.process.manager.ProcessManagerHostedExecutionStrategy$1.callback(ProcessManagerHostedExecutionStrategy.java:49) at org.springframework.roo.process.manager.internal.DefaultProcessManager.doTransactionally(DefaultProcessManager.java:180) at org.springframework.roo.process.manager.internal.DefaultProcessManager.execute(DefaultProcessManager.java:143) at org.springframework.roo.process.manager.ProcessManagerHostedExecutionStrategy.execute(ProcessManagerHostedExecutionStrategy.java:47) at org.springframework.roo.shell.AbstractShell.executeCommand(AbstractShell.java:191) at org.springframework.roo.shell.AbstractShell.executeScriptLine(AbstractShell.java:131) at org.springframework.roo.shell.AbstractShell.script(AbstractShell.java:98) 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.support.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:191) at org.springframework.roo.process.manager.ProcessManagerHostedExecutionStrategy$1.callback(ProcessManagerHostedExecutionStrategy.java:49) at org.springframework.roo.process.manager.internal.DefaultProcessManager.doTransactionally(DefaultProcessManager.java:180) at org.springframework.roo.process.manager.internal.DefaultProcessManager.execute(DefaultProcessManager.java:143) at org.springframework.roo.process.manager.ProcessManagerHostedExecutionStrategy.execute(ProcessManagerHostedExecutionStrategy.java:47) at org.springframework.roo.shell.AbstractShell.executeCommand(AbstractShell.java:191) at org.springframework.roo.shell.jline.JLineShell.promptLoop(JLineShell.java:374) at org.springframework.roo.shell.jline.JLineShell.run(JLineShell.java:135) at java.lang.Thread.run(Thread.java:680) Script required 0 second(s) to execute Script execution aborted java.lang.IllegalStateException: Script execution aborted at org.springframework.roo.shell.AbstractShell.script(AbstractShell.java:103) 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.support.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:191) at org.springframework.roo.process.manager.ProcessManagerHostedExecutionStrategy$1.callback(ProcessManagerHostedExecutionStrategy.java:49) at org.springframework.roo.process.manager.internal.DefaultProcessManager.doTransactionally(DefaultProcessManager.java:180) at org.springframework.roo.process.manager.internal.DefaultProcessManager.execute(DefaultProcessManager.java:143) at org.springframework.roo.process.manager.ProcessManagerHostedExecutionStrategy.execute(ProcessManagerHostedExecutionStrategy.java:47) at org.springframework.roo.shell.AbstractShell.executeCommand(AbstractShell.java:191) at org.springframework.roo.shell.jline.JLineShell.promptLoop(JLineShell.java:374) at org.springframework.roo.shell.jline.JLineShell.run(JLineShell.java:135) at java.lang.Thread.run(Thread.java:680)

    Spring JIRA | 5 years ago | Dirk Joosen
    java.lang.IllegalArgumentException: Unable to obtain required element '/project/artifactId' from element '[project: null]'
  6. 0

    Bad artifact coordinates raised when start coordinator in 0.8.3

    Google Groups | 2 months ago | Luan Cooper
    java.lang.IllegalArgumentException: Bad artifact coordinates postgresql-metadata-storage:0.8.3, expected format is <groupId>:<artifactId>[:<extension>[:<classifier>]]:<version>

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    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