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 multi-module project causes quarkusDev to fail #16023

Closed
kdubb opened this issue Mar 25, 2021 · 4 comments · Fixed by #16080
Closed

Gradle multi-module project causes quarkusDev to fail #16023

kdubb opened this issue Mar 25, 2021 · 4 comments · Fixed by #16080
Labels
area/gradle Gradle area/kotlin kind/bug Something isn't working
Milestone

Comments

@kdubb
Copy link
Contributor

kdubb commented Mar 25, 2021

Describe the bug

The issue manifests itself differently between Java and Kotlin projects but the setup is the same, a multi-module Gradle project where one module depends on one or more other modules and any of the depended on modules have empty sources.

Running quarkusDev in a Kotlin project causes it to fail with gradle outputting Failed to run. If you run with --stacktrace you can see a further error Failed to locate classes directory in the project.

For Java, quarkusDev executes without error but Quarkus startup fails with a rather long chain of exceptions like Exception in thread "main" java.lang.RuntimeException: java.lang.RuntimeException: java.lang.RuntimeException: java.io.UncheckedIOException: Error while reading file as JAR: /Users/kdubb/Downloads/code-with-quarkus/modA/build/classes/java/main

This setup may seem unnecessary but we have some modules that are effectively dependency containers. One of the modules previously had some shared code and when that shared code was removed we encountered this issue; determining the cause of the issue was pretty time consuming.

Expected behavior

quarkusDev completes correctly in both Java & Kotlin projects with this configuration and that Quarkus starts up correctly in the same configuration.

Actual behavior

For Kotlin projects, quarkusDev fails with nondescript Failed to run error.

For Java projects, quarkusDev completes but Quarkus fails to start with Error while reading file as JAR.

To Reproduce

Attached are reproducer projects for both Java & Kotlin. The projects were derived from a simple code start project and adapted to use a shared gradle config in a way that many multi-module projects are setup

code-with-quarkus-kotlin.zip
code-with-quarkus-java.zip

To solve the issues in either project you just need to place a dummy.kt or dummy.java in the appropriate source directory for modA module.

Steps to reproduce the behavior:

  1. Run quarkusDev in modB directory.

Configuration

# Empty file as provided by the codestart

Environment (please complete the following information):

Output of uname -a or ver

Darwin host.local 20.3.0 Darwin Kernel Version 20.3.0: Thu Jan 21 00:07:06 PST 2021; root:xnu-7195.81.3~1/RELEASE_X86_64 x86_64

Output of java -version

java version "11.0.6" 2020-01-14 LTS
Java(TM) SE Runtime Environment 18.9 (build 11.0.6+8-LTS)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.6+8-LTS, mixed mode)

Quarkus version or git rev

1.12.2.Final

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

------------------------------------------------------------
Gradle 6.8.3
------------------------------------------------------------

Build time:   2021-02-22 16:13:28 UTC
Revision:     9e26b4a9ebb910eaa1b8da8ff8575e514bc61c78

Kotlin:       1.4.20
Groovy:       2.5.12
Ant:          Apache Ant(TM) version 1.10.9 compiled on September 27 2020
JVM:          11.0.6 (Oracle Corporation 11.0.6+8-LTS)
OS:           Mac OS X 10.16 x86_64

Additional context

(Add any other context about the problem here.)

@kdubb kdubb added the kind/bug Something isn't working label Mar 25, 2021
@quarkus-bot
Copy link

quarkus-bot bot commented Mar 25, 2021

/cc @evanchooly, @glefloch, @quarkusio/devtools

@kdubb
Copy link
Contributor Author

kdubb commented Mar 25, 2021

This may be related to #10894 as it seems to have an auspicious conclusion.

@glefloch
Copy link
Member

@kdubb thanks for reporting this I will have a look on both issue.

@gilbertopsantosjr
Copy link

is this issue has been fixed ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/gradle Gradle area/kotlin kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants