Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLI - incorrect project folder name #46645

Open
nileshkmahant opened this issue Mar 6, 2025 · 12 comments
Open

CLI - incorrect project folder name #46645

nileshkmahant opened this issue Mar 6, 2025 · 12 comments
Labels
area/cli Related to quarkus cli (not maven/gradle/etc.) kind/bug Something isn't working

Comments

@nileshkmahant
Copy link

Describe the bug

When creating a new project with quarks cli version 3.19.2, it is creating project folder name as "code-with-quarkus" despite of providing project name in command.

console command and result below-

(base) nileshmahant@macbook java % quarkus create && cd my-project

Creating an app (default project type, see --help).
Looking for the newly published extensions in registry.quarkus.io

applying codestarts...
📚 java
🔨 maven
📦 quarkus
📝 config-properties
🔧 tooling-dockerfiles
🔧 tooling-maven-wrapper
🚀 rest-codestart


[SUCCESS] ✅ quarkus project has been successfully generated in:
--> /Users/nileshmahant/workspace/java/code-with-quarkus

Navigate into this directory and get started: quarkus dev
cd: no such file or directory: my-project
(base) nileshmahant@macbook java % ls
code-with-quarkus

Expected behavior

No response

Actual behavior

No response

How to Reproduce?

No response

Output of uname -a or ver

No response

Output of java -version

No response

Quarkus version or git rev

No response

Build tool (ie. output of mvnw --version or gradlew --version)

No response

Additional information

No response

@nileshkmahant nileshkmahant added the kind/bug Something isn't working label Mar 6, 2025
@quarkus-bot quarkus-bot bot added the area/cli Related to quarkus cli (not maven/gradle/etc.) label Mar 6, 2025
Copy link

quarkus-bot bot commented Mar 6, 2025

/cc @ebullient (cli), @maxandersen (cli)

@nileshkmahant
Copy link
Author

Although it works for full command as-
quarkus create app in.example.service:my-api-service:1.0

@jedla97
Copy link
Contributor

jedla97 commented Mar 6, 2025

Hi @nileshkmahant looking at command and you just using quarkus create which will use default values. After that you you switching directories which is separate command.

To make your command work you should use quarkus create app my-project && cd my-project as it's recomended in https://quarkus.io/guides/cli-tooling#project-creation.

@michalvavrik
Copy link
Member

Exactly what @jedla97 said. There is no way how could Quarkus know from quarkus create && cd my-project that you want to create my-project, I think it never worked, so when you say despite of providing project name in command I think you misjudged what these commands mean. quakrus create is one command and if it doesn't fail, second command is executed cd my-project, so you don't provide project name at all. If you still believe there is an issue or space for improvement, please provide more information.

@michalvavrik michalvavrik added triage/invalid This doesn't seem right triage/needs-feedback We are waiting for feedback. and removed triage/invalid This doesn't seem right labels Mar 6, 2025
@nileshkmahant
Copy link
Author

I think we can close this issue.

although using command -> "quarkus create my-project" creates the project directly but in logs there is a error as follows-

Command create-my-project is not available, looking for available plugins ...
[ERROR] ❗ Command create-my-project is missing and can't be installed.

@michalvavrik
Copy link
Member

I think we can close this issue.

although using command -> "quarkus create my-project" creates the project directly but in logs there is a error as follows-

Command create-my-project is not available, looking for available plugins ... [ERROR] ❗ Command create-my-project is missing and can't be installed.

that's actually good catch, I tried it and it does create the project. I think that error message is confusing. Thanks @nileshkmahant

@michalvavrik michalvavrik removed the triage/needs-feedback We are waiting for feedback. label Mar 7, 2025
@michalvavrik
Copy link
Member

@ebullient @maxandersen please read #46645 (comment) and confirm it's a bug or maybe refer to someone else who is looking into Quarkus CLI stuff. I think it is bit confusing:

mvavrik@fedora:/tmp$ quarkus create my-project
Command create-my-project is not available, looking for available plugins ...
[ERROR] ❗  Command create-my-project is missing and can't be installed.
Creating an app (default project type, see --help).
Looking for the newly published extensions in registry.quarkus.io
...
mvavrik@fedora:/tmp$ ls
my-project ....

@maxandersen
Copy link
Member

@iocanel left over from some bad command detection logging ?

@gsmet
Copy link
Member

gsmet commented Mar 10, 2025

@michalvavrik your issue looks similar to what I reported in #45922 .

@michalvavrik
Copy link
Member

michalvavrik commented Mar 10, 2025

I'll close this one and link it/comment to #45922 , indeed seems similar; hope @nileshkmahant is ok with it

@iocanel
Copy link
Contributor

iocanel commented Mar 10, 2025

It seems that we don't support really well hybrid commands (commands with subcommands that may also run as standalone).

I think that what causes the breakage is checking if a plugin is used and if that plugin exists.
Specifically, I think that most probably the issue is somewhere around here:

public Optional<String> checkMissingCommand(CommandLine root, String[] args) {

cc @maxandersen @gsmet

@iocanel iocanel reopened this Mar 10, 2025
@iocanel
Copy link
Contributor

iocanel commented Mar 10, 2025

I am re-openning this, as I am feeling that there are two different issues.
This one is about breaking hybrid commands, the other one seems to be related with commands that have no arguments, just options.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/cli Related to quarkus cli (not maven/gradle/etc.) kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants