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

Gradle Kotlin project with no code cannot be started in Dev mode #45169

Closed
xstefank opened this issue Dec 17, 2024 · 5 comments
Closed

Gradle Kotlin project with no code cannot be started in Dev mode #45169

xstefank opened this issue Dec 17, 2024 · 5 comments

Comments

@xstefank
Copy link
Member

xstefank commented Dec 17, 2024

Describe the bug

$ quarkus create app org.acme:no-code-kotlin --extension quarkus-rest,kotlin --gradle-kotlin-dsl --no-code
$ quarkus dev
> Task :quarkusDev FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':quarkusDev'.
> The `src/main/java` directory is required, please create it.

* 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 3s
9 actionable tasks: 1 executed, 8 up-to-date

Maven works, so this is only issue with Gradle.

Expected behavior

No response

Actual behavior

No response

How to Reproduce?

See the description.

Output of uname -a or ver

No response

Output of java -version

No response

Quarkus version or git rev

3.17.4

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

$ ./gradlew --version ------------------------------------------------------------ Gradle 8.9 ------------------------------------------------------------ Build time: 2024-07-11 14:37:41 UTC Revision: d536ef36a19186ccc596d8817123e5445f30fef8 Kotlin: 1.9.23 Groovy: 3.0.21 Ant: Apache Ant(TM) version 1.10.13 compiled on January 4 2023 Launcher JVM: 21.0.5 (Eclipse Adoptium 21.0.5+11-LTS) Daemon JVM: /home/mstefank/.sdkman/candidates/java/21.0.5-tem (no JDK specified, using current Java home) OS: Linux 6.11.10-300.fc41.x86_64 amd64

Additional information

No response

@xstefank xstefank added the kind/bug Something isn't working label Dec 17, 2024
Copy link

quarkus-bot bot commented Dec 17, 2024

/cc @geoand (kotlin), @glefloch, @quarkusio/devtools

@gsmet
Copy link
Member

gsmet commented Dec 26, 2024

Ideally, when you report an issue, it would be nice if you could go the extra mile and provide a full stack trace in the description.

Granted, I can reproduce it but it's a lot better for search engines and it also helps the maintainers trying to get an understanding of the issue and prioritize properly.

In this case, quarkus dev -e gives you:

Caused by: org.gradle.api.GradleException: The `src/main/java` directory is required, please create it.
        at io.quarkus.gradle.tasks.QuarkusDev.startDev(QuarkusDev.java:334)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:568)
        at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:125)

(for Quarkus 3.17.5)

@gsmet
Copy link
Member

gsmet commented Dec 26, 2024

This is a can of worms - not completely surprised.

It's easy to lift the early restrictions but you then get NPEs further in the build process so I think I will just improve the log message for now.

gsmet added a commit to gsmet/quarkus that referenced this issue Dec 26, 2024
This is unfortunate but we probably need to spend a lot more time to
fully understand all the consequences of lifting this restriction.

Related to quarkusio#45169
@gsmet
Copy link
Member

gsmet commented Dec 26, 2024

I created #45291 for now as an easy win.

I'm not sure if things can be improved further but I will let it to someone interested in contributing to the Gradle plugin.

@gsmet gsmet added kind/enhancement New feature or request and removed kind/bug Something isn't working labels Dec 26, 2024
@xstefank
Copy link
Member Author

xstefank commented Jan 6, 2025

thanks @gsmet, we can open a new issue if there is further change in the gradle plugin.

@xstefank xstefank closed this as completed Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants