Skip to content

fix(forge): name the application after the directory for create-app --inplace - #16985

Draft
borinquenkid wants to merge 2 commits into
8.0.xfrom
fix/forge-inplace-without-name-8.0.x
Draft

borinquenkid wants to merge 2 commits into
8.0.xfrom
fix/forge-inplace-without-name-8.0.x

Conversation

@borinquenkid

@borinquenkid borinquenkid commented Nov 14, 2026 •

Copy link
Copy Markdown
Member

Draft: on hold. The forge and scripts functionality is being rewritten in #17114 (jdaugherty), so this change waits for it.

create-app --inplace without a name in the Forge CLI stopped with "Specify an application name or use --inplace to create an application in the current directory", so the option could not be used alone. With --inplace and no name the application now takes the name of the current directory, as the earlier Grails CLI did; with a name it creates the application in the current directory as before.

Verified locally: the new CreateAppCommandSpec feature fails without the change and passes with it, plus a feature for --inplace with a name; all 11 features of the spec pass. The create-app reference page says how the name is chosen.

Fixes #14872

https://claude.ai/code/session_01Dmki4RzWwreEC2GkkyFnvL

…-inplace

create-app --inplace without a name stopped with 'Specify an application name or
use --inplace', so the option could not be used alone. With --inplace and no
name the application takes the name of the current directory.

Fixes #14872

Claude-Session: https://claude.ai/code/session_01Dmki4RzWwreEC2GkkyFnvL

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@jamesfredley jamesfredley left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not approving. An in-place create in a directory whose name has a dot uses only the last piece of that name.

Project project;
try {
project = NameUtils.parse(name);
project = NameUtils.parse(resolveName());

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

create-app --inplace from a directory named bookstore.demo, with no explicit name, should name the application bookstore.demo. The directory name is found, then parsed as a package, so the application is named demo. Use the directory name as the application name, and still honor a name given on the command.

…-app --inplace

create-app --inplace without a name parsed the directory name as a package, so a directory
named bookstore.demo gave the application the name demo. The directory name is now the
application name as it is, the package is made from it as for a name without dots, and the
class name treats the dot like a hyphen. A name given on the command is still parsed as before.

Refs #14872

Claude-Session: https://claude.ai/code/session_01Dmki4RzWwreEC2GkkyFnvL
@borinquenkid

Copy link
Copy Markdown
Member Author

Fixed in e22451f. With --inplace and no name, the directory name is now the application name as it is, so bookstore.demo names the application bookstore.demo. It was parsed as a package before, and the last piece, demo, became the name.

The package is made from the name as for a name without dots (bookstoredemo), and the class name treats the dot like a hyphen (BookstoreDemo), because a dot is not valid in a class name. A name given on the command is still parsed exactly as before, so create-app --inplace given inside bookstore.demo names it given, and create-app bookstore.demo still means package bookstore, name demo.

Cases: CreateAppCommandSpec runs --inplace in a directory named bookstore.demo with no name (the Application is in bookstoredemo, none in demo) and with a name given (the name wins), and NameUtilsSpec covers the dotted directory, plain directories giving the same project as the same name on the command, and invalid names. The dotted-directory feature fails without the change. The forge-core (407) and forge-cli (41) tests pass and codeStyle is clean.

The new method throws for a directory name that is empty, micronaut, or gives no valid package. That only applies to this path, which stopped with an error before; a name given on the command goes through parse unchanged.

If a directory name still gives the wrong application name, a failing spec or the directory name would show me which.

https://claude.ai/code/session_01Dmki4RzWwreEC2GkkyFnvL

@testlens-app

testlens-app Bot commented Nov 18, 2026

Copy link
Copy Markdown

✅ All tests passed ✅

🏷️ Commit: e22451f
▶️ Tests: 88699 executed
⚪️ Checks: 96/96 completed


Learn more about TestLens at testlens.app/docs.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

Command line option --inplace does not work

3 participants