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

Problems Running runCommand #13732

Open
osscontributor opened this issue Oct 6, 2024 · 2 comments
Open

Problems Running runCommand #13732

osscontributor opened this issue Oct 6, 2024 · 2 comments

Comments

@osscontributor
Copy link
Member

osscontributor commented Oct 6, 2024

Expected Behavior

The gradle runCommand task should work.

Actual Behaviour

In a default generated app, runCommand generates an error.

Steps To Reproduce

Invoke the runCommand task in a Grails 6.2.1 app.

$ [] sdk use grails 6.2.1

Using grails version 6.2.1 in this shell.
$ [] 
$ [] sdk use java 11.0.17-zulu 

Using java version 11.0.17-zulu in this shell.
$ [] 
$ [] grails create-app runcommanddemo
| Application created at /Users/jeffbrown/runcommanddemo
$ [] 
$ [] cd runcommanddemo 
$ [] 
$ [] 
$ [] ./gradlew runCommand -Pargs="url-mappings-report"

> Task :runCommand FAILED
Application class not found

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':runCommand'.
> Process 'command '/Users/jeffbrown/.sdkman/candidates/java/11.0.17-zulu/zulu-11.jdk/Contents/Home/bin/java'' finished with non-zero exit value 1

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 7s
6 actionable tasks: 6 executed

Environment Information

No response

Example Application

No response

Version

6.2.1

@Taack
Copy link

Taack commented Oct 6, 2024

in the build.gradle, you should add the mainClass path.

application {
    mainClass.set("t621.Application")
}

But even with this path set, it does not work, stating:

> Task :runCommand FAILED
| Error Command not found for name: <name-of-the-command>

I can provide a test case if needed. I think a dependency is missing in my case (using default create-app deps).

@osscontributor
Copy link
Member Author

I can provide a test case if needed.

Thank you @Taack!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants