[Bug] Unable to create new Spring Boot application with the latest version of NX
Plugin Name
@nxrocks/nx-spring-boot
Nx Report
NX Report complete - copy this into the issue template
Node : 20.18.0
OS : linux-x64
Native Target : x86_64-linux
bun : 1.1.30
nx : 20.0.0
@nx/js : 20.0.0
@nx/eslint : 20.0.0
@nx/workspace : 20.0.0
@nx/angular : 20.0.0
@nx/devkit : 20.0.0
@nx/vite : 20.0.0
@nx/web : 20.0.0
@nx/webpack : 20.0.0
typescript : 5.6.3
---------------------------------------
Community plugins:
@analogjs/content : 1.8.2
@analogjs/platform : 1.8.2
@analogjs/router : 1.8.2
@analogjs/vite-plugin-angular : 1.8.2
@nxrocks/nx-spring-boot : 10.2.6
### Expected Behaviour
Create a project using `nx g @nxrocks/nx-spring-boot:project`.
### Actual Behaviour
```~/Workspace/Work/Bedrock git:[main] bunx nx g @nxrocks/nx-spring-boot:project test --verbose
NX Generating @nxrocks/nx-spring-boot:project
✔ What kind of project are you generating? · application
✔ Which build system would you like to use? · maven-project
✔ Which packaging would you like to use? · jar
✔ Which version of Java would you like to use? · 22
✔ Which language would you like to use? · java
✔ What groupId would you like to use? · com.test
✔ What artifactId would you like to use? · test
✔ What package name would you like to use? · com.test.api
NX Cannot read properties of undefined (reading 'replace')
TypeError: Cannot read properties of undefined (reading 'replace')
at removeWindowsDriveLetter (/home/user/Workspace/Work/Bedrock/node_modules/nx/src/utils/path.js:9:27)
at normalizePath (/home/user/Workspace/Work/Bedrock/node_modules/nx/src/utils/path.js:16:12)
at determineProjectNameAndRootOptions (/home/user/Workspace/Work/Bedrock/node_modules/@nx/devkit/src/generators/project-name-and-root-utils.js:10:58)
at normalizeOptions (/home/user/Workspace/Work/Bedrock/node_modules/@nxrocks/nx-spring-boot/src/generators/project/lib/normalize-options.js:6:144)
at projectGenerator (/home/user/Workspace/Work/Bedrock/node_modules/@nxrocks/nx-spring-boot/src/generators/project/generator.js:9:64)
at /home/user/Workspace/Work/Bedrock/node_modules/nx/src/command-line/generate/generate.js:238:32
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async handleErrors (/home/user/Workspace/Work/Bedrock/node_modules/nx/src/utils/handle-errors.js:9:24)
at async Object.handler (/home/user/Workspace/Work/Bedrock/node_modules/nx/src/command-line/generate/command-object.js:14:22)
### Steps to reproduce the behaviour
1. Create new nx workspace with "none" preset
2. Install @nxrocks/nx-spring-boot
3. Try and create a spring boot application
It seems like the options.directory value is null when logging out the options in normalize-options.js
Hi @Divaaaaaan
Thanks for reporting this, I'll have a look and provide an update soonish.
Stay tuned!
Hi @tinesoft
Cool no worries, did some investigating quick and it seems like the structure might have changed as the options for the generator doesn't seem to be passed through anymore. In the interim, I just updated that file to use options.name as the directory as well which is working but hope this helps make the checking on your side quicker and easier.
@tinesoft Just an update, seems like things are not playing well together when I edited the file :sweat_smile: so will wait for the update rather before continuing.
Having a look at the Nx plugin registry, it supports the Nx version between 16 and 18. When will the plugin be updated accordingly? Let me know if I can help upgrading.
Hi @Divaaaaaan.
"In Nx 20, generating projects will no longer derive the name and root"
So the correct way to create projects now is:
nx g @nxrocks/nx-spring-boot:project testapp --directory apps/testapp
This same change affects both Spring Boot and Flutter projects in Nx 20.
@lordvins226 Ah great, didn't see that in Nx 20. Thank you very much will have a look :ok_hand:
Hi @Divaaaaaan.
"In Nx 20, generating projects will no longer derive the name and root"
So the correct way to create projects now is:
nx g @nxrocks/nx-spring-boot:project testapp --directory apps/testappThis same change affects both Spring Boot and Flutter projects in Nx 20.
I seem to have this exact same problem here, I do not seem to understand how to do the fix you suggested on my end.
Hi all
@crafael23 I'm actively updating all the create-nx-* packages for official support for Nx 20. It should be released very soon.
I'll post back here when available.
@lordvins226 thank you very much, it works for me. you save my time.
i got the some problem and try to fix but it not work.
how to fix this problem ?
lordvins226, hello! Thank you very much for providing a workaround! :heartbeat:
i got the some problem and try to fix but it not work.
how to fix this problem ?
@Hychin123 correct command: npx nx g @nxrocks/nx-spring-boot:project ecom-backend --directory apps/ecom-backend
Sorry for the long overdue....
Supports for Nx v20+ has officially landed with latest versions of the plugin.

