When I try to create a jar build using gradle and jdk 11, the following error always occurs:
10:53:41: Executing task 'build'...
> Task :compileJava
> Task :compileJava UP-TO-DATE
> Task :processResources UP-TO-DATE
> Task :classes UP-TO-DATE
> Task :bootJar UP-TO-DATE
> Task :jar SKIPPED
> Task :assemble UP-TO-DATE
> Task :compileTestJava UP-TO-DATE
> Task :processTestResources NO-SOURCE
> Task :testClasses UP-TO-DATE
> Task :test FAILED
> Task :jacocoTestReport UP-TO-DATE
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':test'.
> failed to read class file /home/rodrigo/Projetos/Gaia/apipessoas/build/classes/java/test/com/rjdesenvolvimento/apipessoas/ApipessoasApplicationTests.class
* 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
Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0.
See https://docs.gradle.org/4.8.1/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 1m 9s
6 actionable tasks: 1 executed, 5 up-to-date
Unsupported class file major version 55
10:54:50: Task execution finished 'build'.
I'm lost and need help. I have tried to change the mavencentral () repository to jcenter and without success.
When I use jdk 1.8 the error does not occur, however I need jdk 11, boss orders = (
ADD NEW INFO**************************
13:29:00: Executing task 'build'...
Task :compileJava UP-TO-DATE
Task :processResources UP-TO-DATE
Task :classes UP-TO-DATE
Task :bootJar UP-TO-DATE
Task :jar
Task :assemble
Task :compileTestJava UP-TO-DATE
Task :processTestResources NO-SOURCE
Task :testClasses UP-TO-DATE
Task :test
WARNING: An illegal reflective access operation has occurred WARNING: Illegal reflective access by org.springframework.cglib.core.ReflectUtils$1 (file:/home/rodrigo/.gradle/caches/modules-2/files-2.1/org.springframework/spring-core/5.0.9.RELEASE/9f9a828936d81afd49a603bda9cc1aed863a0d85/spring-core-5.0.9.RELEASE.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain) WARNING: Please consider reporting this to the maintainers of org.springframework.cglib.core.ReflectUtils$1 WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations WARNING: All illegal access operations will be denied in a future release
com.rjdesenvolvimento.apipessoas.ApipessoasApplicationTests > contextLoads FAILED
java.lang.IllegalStateException
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException
Caused by: org.springframework.beans.factory.BeanCreationException
Caused by: org.springframework.beans.factory.BeanCreationException
Caused by: org.springframework.beans.factory.BeanCreationException
Caused by: org.springframework.jdbc.datasource.init.ScriptStatementFailedException
Caused by: org.postgresql.util.PSQLException
1 test completed, 1 failed
Task :test FAILED Task :jacocoTestReport
FAILURE: Build failed with an exception.
What went wrong: Execution failed for task ':test'. There were failing tests. See the report at: file:///home/rodrigo/Projetos/Gaia/apipessoas/build/reports/tests/test/index.html
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
Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0. Use '--warning-mode all' to show the individual deprecation warnings. See https://docs.gradle.org/4.10.2/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 10s 7 actionable tasks: 3 executed, 4 up-to-date There were failing tests. See the report at: file:///home/rodrigo/Projetos/Gaia/apipessoas/build/reports/tests/test/index.html 13:29:11: Task execution finished 'build'.