-
Notifications
You must be signed in to change notification settings - Fork 39
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
Maven plugin fails on Java 8 project due to ClassNotFoundException: kotlin.jdk7.AutoCloseableKt #2657
Comments
Additional clues, perhaps! If I manually remove
Looks like we're getting % unzip -t ~/.m2/repository/org/jetbrains/kotlin/kotlin-stdlib-jdk7/1.8.0/kotlin-stdlib-jdk7-1.8.0.jar | grep AutoCloseableKt
# (no grep results printed) Is the UnitTestBot Maven plugin requesting the wrong version of this |
Description
I built UTBotJava-2023.10 using Java 17, after finding that both Java 8 and Java 11 resulted in build failures.
I added the UTBotJava Maven plugin to an open-source project's
pom.xml
, then tried to use Maven to run theutbot:generateTestsAndSarifReport
task. The target project is still based on Java 8, so I setJAVA_HOME
to a Java 8 JDK when running Maven. Theutbot:generateTestsAndSarifReport
task failed, reportingjava.lang.ClassNotFoundException: kotlin.jdk7.AutoCloseableKt
. Using a Java 17 JDK when running Maven fails even earlier, as the target application does not compile under Java 17.To Reproduce
Steps to reproduce the behavior:
Build UTBotJava using a Java 17 JDK. In my case, running on MacOS, I used:
Check out nilzao/soapbox-race@5acac4da. Other revisions might exhibit the same problem, but that's the specific revision I used.
Modify
soapbox-race
'spom.xml
by adding the following lines to the<plugins>
section:Using a Java 8 JDK, run Maven with the
utbot:generateTestsAndSarifReport
target:Also try using the same Java 17 JDK that was used to compile UTBotJava:
Expected behavior
Tests and a SARIF report should be generated.
Actual behavior
When running Maven using Java 8, failure due to
java.lang.ClassNotFoundException: kotlin.jdk7.AutoCloseableKt
.When running Maven using Java 17, failure to compile the target application.
Visual proofs (screenshots, logs, images)
Environment
The text was updated successfully, but these errors were encountered: