generator-jhipster: Application can't be run if the package name using a reserved Java keyword
When I tried to generate an application with a package name contains a reserved Java keyword (in my case “for”) no errors occurred but the application can’t be run. See the output :
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.068 s
[INFO] Finished at: 2020-07-30T14:08:17-04:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:properties-maven-plugin:1.0.0:read-project-properties (default) on project test: Properties could not be loaded from File: sonar-project.properties -> [Help 1]
I replaced “for” by any other word and try to follow Java convention “for_” and the project run like expected (no files are missing in that case)
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 15 (13 by maintainers)
Commits related to this issue
- Validate that packageName does not include a java reserved keyword Fix #12180 — committed to gmarziou/generator-jhipster by gmarziou 4 years ago
@gmarziou It seems the issue you mentioned is fixed. Can we close this issue?
Once jhipster/jhipster-core#479 is merged and released, the generator can be updated to validate the package name.
The online generator frontend code uses the same regex: and finally it calls generator-jhipster, so I guess that adding the check in generator-jhipster would make the project generation to fail but I don’t know what would be the user experience in this case.