javaspringspring-roospring-tool-suiteroo

Illegal name when creating a new Spring Roo project


When you try to use "dash sign" in project name in a new Spring Roo project (Roo 2.0 RC1) in STS (v. 3.8.4) that causes project generation to fail.

Basically, in New Roo Project window, when you start entering project name it accepts alphanumeric characters and dash sign (-) fine. Other characters like backslash are not accepted - you get "\ is an invalid character in resource name".

Therefore, I'd assume dash should be fine. Yet, I get this:

roo> project setup --topLevelPackage com.example --projectName "spider-man" --java 8 --packaging JAR
Created ROOT\pom.xml
Undo create ROOT\pom.xml
Illegal name 'com.example.Spider-manApplication' (illegal character)

The easy workaround is not to use "dash", like in the example: instead of "spider-man" use "spiderman" and rename the project later (if you really want that dash). However, I find this counterintuitive, especially because dash is accepted fine in the Roo Project Wizard.

Is there a way to use the wizard with dash sign in project name?


Solution

  • Spring Roo shell doesn't allow to use dash in the --projectName parameter during project generation.

    However, seems like this restriction is not beeing applied by the STS Roo Wizard.

    By the moment, is not possible to use "dash" character in the Spring Roo Shell.

    I've just create the following ticket in JIRA to analyze how to manage this behaviour.

    https://jira.spring.io/browse/ROO-3916

    Hope it helps,