I downloaded a default application from https://code.quarkus.io/, changed maven.compiler.source/target to 11, and added a Java 11 feature to org.acme.ExampleResource like var x = 1.
Then I started a build using mvnw package -Pnative -Dquarkus.native.container-build=true.
In the logs I see:
[INFO] [io.quarkus.deployment.pkg.steps.NativeImageBuildStep] Running Quarkus native-image plugin on GraalVM Version 19.2.1 CE
As expected the build now fails with the error message
UnsupportedFeatureException: Class initialization of io.quarkus.runner.ApplicationImpl failed
Cause is
UnsupportedClassVersionError: org/acme/ExampleResource has been compiled by a more recent version of the Java Runtime (class file version 55.0)
Why does it use Graal VM 19.2.1 instead of 19.3.1?
If I do a multistage build like described on https://quarkus.io/guides/building-native-image, the compilation works.
Related
I am supporting many teams for bamboo build including sonar. One of my team using CXX plugin .
Now we are facing issue after installing the plugin. Because many other team still depends on JDK 8 and CXX will support JDK 11. Is there any way to exclude CXX plugin for specific project or build ?
I tried -Dsonar.exclusions=/.h,/.c,**/.hh,/.hpp,/*.cc,.cxx,.cpp,.hxx but not success.
Error :
Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.3.0.603:sonar (default-cli) on project ABC: The plugin [cxx] does not support Java 1.8.0_312: org/sonar/plugins/cxx/CxxPlugin has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0 → [Help 1]
I am trying to build a spring-boot Microservice.
The build is using releasee 2.4.0 of spring-boot.
I am trying to compile this build with the new release 1.4.20 of kotlin.
How can I build this without failures?
Try to create a kotlin Microservice with start.spring.io. Edit the pom to use the newest kotlin release...
When building:
Execution compile of goal org.jetbrains.kotlin:kotlin-maven-plugin:1.4.20:compile failed: A required class was missing while executing org.jetbrains.kotlin:kotlin-maven-plugin:1.4.20:compile: kotlin/reflect/KDeclarationContainer
...
If you choose kotlin as main language (as one should) and picks java 15, one get the following error:
Compilation failure
[ERROR] Unknown JVM target version: 15
[ERROR] Supported versions: 1.6, 1.8, 9, 10, 11, 12, 13, 14
There is something fundamentally wrong with the spring-boot configuration provided from start.spring.io as the target of the new kotlin version 1.4.20 is java 15: what's new in kotlin 1.4.20
The error seemed to be a bug only visible on Mac OS Big Sur (intel version), but was solved by updating to kotlin release 1.4.21
updating kotlin version works for me.
I am trying to build a native image for an application using quarkus-infinispan-client and quarkus-grpc w/o GraalVM installed with :
mvnw package -Pnative -Dquarkus.native.container-build=true -DskipTests
The build fails with : com.oracle.svm.core.util.UserError$UserException: Classes that should be initialized at run time got initialized during image building with some netty classes.
I have tried with Quarkus 1.6, 1.7 and 1.8 with a minimal application having only the two dependencies added with the same result.
Can it be a bug or I am doing something wrong ? Is there any workaround ?
Also I get a lot of warnings with Dependencies with duplicate files detected
mainly in wildfly classes.
To reproduce the problem only the dependencies need to be defined in the pom
there is no need to use any of them.
I'm currently working on a Kotlin project with Gradle (source code here). It's a Bukkit plugin which depends on a library I maintain (library source code here). When running ./gradlew assemble in a terminal, everything works fine and the build succeeds (log below).
$ ./gradlew assemble --console plain
> Task :compileKotlin
w: Some JAR files in the classpath have the Kotlin Runtime library bundled into them. This may cause difficult to debug problems if there's a different version of the Kotlin Runtime library in the classpath. Consider removing these libraries from the classpath
w: /home/axel/.gradle/caches/modules-2/files-2.1/com.github.axelrindle/PocketKnife/v1.3.0/b2303013bfd8e21c419f1d640ef374afc48e86af/PocketKnife-v1.3.0.jar: Library has Kotlin runtime bundled into it
> Task :compileJava NO-SOURCE
> Task :processResources
> Task :classes
> Task :inspectClassesForKotlinIC
> Task :jar
> Task :assemble
BUILD SUCCESSFUL in 5s
4 actionable tasks: 4 executed
But when working in IDEA, my library is the only one the IDE fails to resolve for whatever reason.
I've already tried the following steps:
Delete gradle/idea caches (~/.gradle/caches;.idea)
Reinstall IDEA
Delete IDEA config directory (.IdeaIC2019.1)
Reimport the project in IDEA
I've already read the following questions/answers, but none of them worked:
Getting Gradle dependencies in IntelliJ IDEA using Gradle build
Unable to resolve dependencies in IntelliJ IDEA 2018.1
Gradle dependencies not working in IntelliJ
IntelliJ won't recognize some imports from gradle project
Intellij: Gradle dependency not found
Also, my idea.log can be found here: https://pastebin.com/0Z5b3Wdp
Last but not least some version information:
IntelliJ IDEA 2019.1.3 (Community Edition)
Build #IC-191.7479.19, built on May 28, 2019
JRE: 1.8.0_202-release-1483-b58 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Linux 4.18.0-21-generic
$ ./gradlew --version
------------------------------------------------------------
Gradle 5.4.1
------------------------------------------------------------
Build time: 2019-04-26 08:14:42 UTC
Revision: 261d171646b36a6a28d5a19a69676cd098a4c19d
Kotlin: 1.3.21
Groovy: 2.5.4
Ant: Apache Ant(TM) version 1.9.13 compiled on July 10 2018
JVM: 12.0.1 (Oracle Corporation 12.0.1+12)
OS: Linux 4.18.0-21-generic amd64
After a lot of failed troubleshooting, I found out what the problem was. My library contained the bundled kotlin runtime, which was causing impossible to debug resolving issues with IDEA. I split up the project into multiple subprojects, where the actual api dependency does not bundle the kotlin runtime. This fixed my issues.
I just cloned your repository from https://github.com/axelrindle/Broadcaster-Plugin
In your build.gradle file you are referencing version 1.2.2 of your PocketKnife artefact, which does not exist in your GitHub. If you use an existing version like 1.2.1 IntelliJ can resolve the dependency.
Here is the github repo: https://github.com/entrpn/gradle_plugin. You will need to manually create a folder "repo" at the root of the project since git doesn't add empty directories. That is where the generated files are supposed to go when running:
./gradlew uploadArchives
I am trying to write a simple gradle plugin following this tutorial https://afterecho.uk/blog/create-a-standalone-gradle-plugin-for-android-a-step-by-step-guide.html and when I get to the part where I am trying to create the local maven repo, I am not able to.
Problem: I am using the gradle wrapper command line:
./gradlew uploadArchives
and I receive the above error. Anyone know what I am doing wrong. Here is the log output:
Executing org.gradle.api.internal.tasks.compile.ApiGroovyCompiler in worker daemon.
16:20:23.624 [INFO] [org.gradle.workers.internal.WorkerDaemonServer] Exception executing org.gradle.api.internal.tasks.compile.ApiGroovyCompiler in worker daemon: java.lang.ExceptionInInitializerError.
16:20:23.636 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationWorkerRegistry] Worker root.2.3 completed (1 in use)
16:20:23.636 [DEBUG] [org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter] Removed task artifact state for {} from context.
16:20:23.636 [DEBUG] [org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter] Finished executing task ':compileGroovy'
Thank you.
Ok I figured it out. Jason's answer gave me a clue. I opened terminal and ran ./gradlew --version and got this output:
Gradle 3.5-rc-2
Build time: 2017-03-27 15:56:23 UTC
Revision: ec63970cd167993d3dcda346a1d00a286a23b1c9
Groovy: 2.4.10
Ant: Apache Ant(TM) version 1.9.6 compiled on June 29 2015
JVM: 1.8.0_131 (Oracle Corporation 25.131-b11)
OS: Mac OS X 10.12.6 x86_64
So I noticed the Groovy version is 2.4.10 so I changed the gradle file to use this version, recompiled and the files were generated.
When I tried to run it I received the following error in addition to yours,
When I tried to run it I received the following error, "Caused by: groovy.lang.GroovyRuntimeException: Conflicting module versions. Module [groovy-all is loaded in version 2.4.7 and you are trying to load version 2.3.11"
I modified build.gradle and changed line 14 from
compile 'org.codehaus.groovy:groovy-all:2.3.11'
to
compile 'org.codehaus.groovy:groovy-all:2.4.7'