-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Continuous testing fails when a dependency brings in an optional dependency and a Jandex index #24943
Comments
/cc @stuartwdouglas |
I don't know if there is much we can do here. This happens because you have an application class (i.e. one in the same maven project), that is referencing a missing dependency. Continuous testing will attempt to transform this class to do usage tracing, so we know what tests we need to run if it is modified. For now you can work around it by moving this code into a different project, so it is not considered hot replaceable and won't be instrumented. |
@stuartwdouglas, I wanted to make sure this issue was signalled but if it's something that can't be fixed than I can workaround it without much problem. That said, I feel that this might be a not-so-uncommon issue (particularly for people migrating older projects to Quarkus) so I think it should at least be shown in the documentation as a known limitation. Maybe here, where the Jandex plugin is described or in the continuous testing guide. Workaround wise, I use a slightly less intrusive one than the one you suggest, I just add the optional dependency to the quarkus module in the test scope. |
The linked PR should help. |
The live testing is not reloading changes!! |
Fixes quarkusio#24943 (cherry picked from commit af5949b)
Describe the bug
When in a multi-module maven project, with a quarkus module
A
depending on a regular java moduleB
. If moduleB
contains both an optional dependecy (not declared byA
too) and a Jandex index, then continuous testing fails with aBuildException
.It makes no difference whether the classes in
B
using the optional dependencies are used by the quarkus module or its tests.Regular testing via maven still works correctly, though.
Expected behavior
Continuous testing should build and execute the tests.
Actual behavior
A
BuildException
is thrown:(the stack trace goes on for around 300 lines, but this is the most relevant part)
How to Reproduce?
Reproducer: https://github.com/linkareti/quarkus-optional-dep-test-issue-reproducer
Steps to reproduce the behaviour:
mvn clean install
in the project's rootcode-with-quarkus
mvn clean quarkus:test
Output of
uname -a
orver
Linux [...] 5.16.18-200.fc35.x86_64 #1 SMP PREEMPT Mon Mar 28 14:10:07 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
Output of
java -version
openjdk version "11.0.14.1" 2022-02-08
OpenJDK Runtime Environment 18.9 (build 11.0.14.1+1)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.14.1+1, mixed mode, sharing)
GraalVM version (if different from Java)
n/a
Quarkus version or git rev
2.8.0.Final, but I've seen the issue since 2.6.3.Final
Build tool (ie. output of
mvnw --version
orgradlew --version
)Apache Maven 3.8.1 (05c21c65bdfed0f71a2f2ada8b84da59348c4c5d)
Maven home: /home/bnazare/tools/apache-maven-3.8.1
Java version: 11.0.14.1, vendor: Red Hat, Inc., runtime: /usr/lib/jvm/java-11-openjdk-11.0.14.1.1-5.fc35.x86_64
Default locale: pt_PT, platform encoding: UTF-8
OS name: "linux", version: "5.16.18-200.fc35.x86_64", arch: "amd64", family: "unix"
Additional information
No response
The text was updated successfully, but these errors were encountered: