Could not dispatch a message to the daemon - gradle

when i execute "gradle assembleRelease",sometimes i get a error :
03:23:01.987 [ERROR] [org.gradle.BuildExceptionReporter] FAILURE: Build failed with an exception.
03:23:01.987 [ERROR] [org.gradle.BuildExceptionReporter]
03:23:01.988 [ERROR] [org.gradle.BuildExceptionReporter] * What went wrong:
03:23:01.988 [ERROR] [org.gradle.BuildExceptionReporter] Could not dispatch a message to the daemon.
03:23:01.988 [ERROR] [org.gradle.BuildExceptionReporter]
03:23:01.988 [ERROR] [org.gradle.BuildExceptionReporter] * Exception is:
03:23:01.989 [ERROR] [org.gradle.BuildExceptionReporter] org.gradle.launcher.daemon.client.DaemonConnectionException: Could not dispatch a message to the daemon.
03:23:01.989 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.daemon.client.DaemonClientConnection.dispatch(DaemonClientConnection.java:72)
03:23:01.990 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.daemon.client.DaemonClient.executeBuild(DaemonClient.java:167)
03:23:01.990 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.daemon.client.SingleUseDaemonClient.execute(SingleUseDaemonClient.java:55)
03:23:01.990 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.daemon.client.SingleUseDaemonClient.execute(SingleUseDaemonClient.java:37)
03:23:01.990 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:43)
03:23:01.990 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.internal.Actions$RunnableActionAdapter.execute(Actions.java:170)
03:23:01.991 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:237)
03:23:01.991 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:210)
03:23:01.991 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:35)
03:23:01.991 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:24)
03:23:01.992 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:206)
03:23:01.992 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:169)
03:23:01.992 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33)
03:23:01.992 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:22)
03:23:01.992 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.Main.doAction(Main.java:33)
03:23:01.993 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)
03:23:01.993 [ERROR] [org.gradle.BuildExceptionReporter] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
03:23:01.993 [ERROR] [org.gradle.BuildExceptionReporter] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
03:23:01.993 [ERROR] [org.gradle.BuildExceptionReporter] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
03:23:01.993 [ERROR] [org.gradle.BuildExceptionReporter] at java.lang.reflect.Method.invoke(Method.java:606)
03:23:01.994 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:54)
03:23:01.994 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:35)
03:23:01.994 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.GradleMain.main(GradleMain.java:23)
03:23:01.994 [ERROR] [org.gradle.BuildExceptionReporter] Caused by: org.gradle.messaging.remote.internal.MessageIOException: Could not write message org.gradle.launcher.daemon.protocol.Finished#266bad10 to '/0:0:0:0:0:0:0:1:53366'.
03:23:01.994 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.messaging.remote.internal.inet.SocketConnection.dispatch(SocketConnection.java:111)
03:23:01.995 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.daemon.client.DaemonClientConnection.dispatch(DaemonClientConnection.java:63)
03:23:01.995 [ERROR] [org.gradle.BuildExceptionReporter] ... 22 more
03:23:01.995 [ERROR] [org.gradle.BuildExceptionReporter] Caused by: java.io.IOException: Broken pipe
03:23:01.995 [ERROR] [org.gradle.BuildExceptionReporter] at sun.nio.ch.FileDispatcherImpl.write0(Native Method)
03:23:01.996 [ERROR] [org.gradle.BuildExceptionReporter] at sun.nio.ch.SocketDispatcher.write(SocketDispatcher.java:47)
03:23:01.996 [ERROR] [org.gradle.BuildExceptionReporter] at sun.nio.ch.IOUtil.writeFromNativeBuffer(IOUtil.java:93)
03:23:01.996 [ERROR] [org.gradle.BuildExceptionReporter] at sun.nio.ch.IOUtil.write(IOUtil.java:51)
03:23:01.996 [ERROR] [org.gradle.BuildExceptionReporter] at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:487)
03:23:01.996 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.messaging.remote.internal.inet.SocketConnection$SocketOutputStream.flush(SocketConnection.java:236)
03:23:01.997 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.messaging.remote.internal.inet.SocketConnection.dispatch(SocketConnection.java:109)
03:23:01.997 [ERROR] [org.gradle.BuildExceptionReporter] ... 23 more
the gradle version is 2.7.
I can't find any information about this error,Want to know about it can give me some inspiration,thanks!

Try restarting the daemon. Perhaps it was killed for some reason
gradle --stop && gradle clean build

for me it was about GRADLE_HOME environmental variable. I hadn't set GRADLE_HOME.
these steps might help:
point to advanced system settings -> environmental variables
make an environmental variable named "GRADLE_HOME"
give the address of your gradle file (you can find it on Users -> YOUR_USER_NAME -> .gradle -> GRADLE_VERSION (like: 4.4) or if you didn't find it here, you can download one from https://services.gradle.org/distributions/ and extract it in the path mentioned and give it's directory address for the GRADLE_HOME variable.

I solved my issue by installing the version 8 of the OpenJDK Hotspot JVM. Previously I was using version 11 of the OpenJDK OpenJ9 JVM. Not sure if it's because I went from V11 to V8 or from OpenJ9 to Hotspot.

I drop the folder of gradle in my home
rm -Rf ~/.gradle
it's works for me.

In my case it was simply a lack of heap memory.
I found out the reason by trying to start the daemon manually with
gradle --daemon
That produced the following error message:
Error occurred during initialization of VM
Could not reserve enough space for object heap

cd android && gradlew clean && cd .. && react-native run-android
Hit this command from Project root directory.

I just delete the daemon files, just look for the corresponding version in ~/.gradle/daemon and delete them

For me (Cordova/Ionic Project), stopping cleaning didn't work because Gradle Daemon was not being properly used in the build. I have IBM JRE also installed in my machine as in my Environment PATH variable.
So I opened android folder in Android Studio and build was success, but with this warning.
that Gradle Daemon is using 'C:\Program Files\Android\Android Studio\jre' with couple of more warnings for not using JRE set in PATH.
so for my cordova project I had to this
cd platforms/android/ && gradlew.bat clean build -Dorg.gradle.java.home="C:\Program Files\Android\Android Studio\jre"
And build success!

it worked for me.
just add this line on your gradlew.properties
org.gradle.jvmargs=-Xmx4608m

Related

How to print maven's vmRun[N].dump to console?

mvn test failed due to an exception, but all the exception stacks are recorded in the dump file and cannot be seen directly on the console. Can all exceptions be output to the console?
[ERROR] Please refer to dump files (if any exist) [date]-jvmRun[N].dump, [date].dumpstream and [date]-jvmRun[N].dumpstream.
[ERROR] There was an error in the forked process
[ERROR]
[ERROR] Cannot instantiate class abc
[ERROR] org.apache.maven.surefire.booter.SurefireBooterForkException: There was an error in the forked process
[ERROR]
[ERROR] Cannot instantiate class abc
[ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:665)
[ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:533)
[ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:279)
[ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:243)
[ERROR] at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeProvider(AbstractSurefireMojo.java:1077)
[ERROR] at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeAfterPreconditionsChecked(AbstractSurefireMojo.java:907)
[ERROR] at org.apache.maven.plugin.surefire.AbstractSurefireMojo.execute(AbstractSurefireMojo.java:785)
[ERROR] at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
[ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
[ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:154)
[ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:146)
[ERROR] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117)
[ERROR] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)
[ERROR] at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
[ERROR] at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
[ERROR] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:309)
[ERROR] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:194)
[ERROR] at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:107)
[ERROR] at org.apache.maven.cli.MavenCli.execute(MavenCli.java:993)
[ERROR] at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:345)
[ERROR] at org.apache.maven.cli.MavenCli.main(MavenCli.java:191)
[ERROR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[ERROR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[ERROR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[ERROR] at java.lang.reflect.Method.invoke(Method.java:498)
[ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
[ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
[ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
[ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
[ERROR]
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

maven-surefire-plugin failing with OpenJDK 17 on gitlab-ci

Running Gitlab CI suddenly started failing with this exception:
/usr/java/openjdk-17/bin/java -Xmx1024m -XX:MaxPermSize=256m -jar /builds/myapp/target/surefire/surefirebooter15709646820034007555.jar /builds/myapp/target/surefire 2021-10-12T20-04-21_120-jvmRun1 surefire10652468672509302756tmp surefire_03968859309758681259tmp
[ERROR] Error occurred in starting fork, check output in log
[ERROR] Process Exit Code: 1
[ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:669)
[ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:282)
[ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:245)
[ERROR] at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeProvider(AbstractSurefireMojo.java:1183)
[ERROR] at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeAfterPreconditionsChecked(AbstractSurefireMojo.java:1011)
[ERROR] at org.apache.maven.plugin.surefire.AbstractSurefireMojo.execute(AbstractSurefireMojo.java:857)
[ERROR] at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:137)
[ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:210)
[ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:156)
[ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:148)
[ERROR] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117)
[ERROR] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)
[ERROR] at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:56)
[ERROR] at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
[ERROR] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:305)
[ERROR] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:192)
[ERROR] at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:105)
[ERROR] at org.apache.maven.cli.MavenCli.execute(MavenCli.java:972)
[ERROR] at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:293)
[ERROR] at org.apache.maven.cli.MavenCli.main(MavenCli.java:196)
[ERROR] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[ERROR] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
[ERROR] at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[ERROR] at java.base/java.lang.reflect.Method.invoke(Method.java:568)
[ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:282)
[ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:225)
[ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:406)
[ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:347)
Unfortunately it is not really informative about what the problem really is.
However, I noticed that it was using the new openjdk-17. So I suspected it might be an issue related to this. In my .gitlab-ci.yml I swapped maven:latest with maven:3-jdk-11 to force it to stay on JDK 11 as follows:
#image: maven:latest
image: maven:3-jdk-11
And it worked fine.
Any idea why maven-surefire-plugin failed on OpenJDK 17?

Kotlin plugin error: Could not generate a proxy class for class org.jetbrains.kotlin.gradle.tasks.KotlinCompile

Getting an error while trying to run a gradle task. Can't figure out what else is required or what the error is about. The project I'm working on has several subprojects, so I have a main build.gradle. The error is for a subproject where I wanted to try Kotlin.
* Where: Build file '/home/oracle/bnc/KotlinHandler/build.gradle' line: 13
* What went wrong: A problem occurred evaluating root project 'KotlinHandler'.
> Failed to apply plugin [id 'kotlin']
> Could not generate a proxy class for class org.jetbrains.kotlin.gradle.tasks.KotlinCompile.
Here is my build.gradle for the failing module (sub-project).
buildscript {
ext.kotlin_version = '1.1.2-2'
repositories {
mavenCentral()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
apply plugin: 'kotlin'
repositories {
mavenCentral()
}
dependencies {
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
}
Here is Pastebin build.gradle which is quite big, because of all the tasks in it
Added --debug output after changing jdk to 1.8 and compile dependency to compile "org.jetbrains.kotlin:kotlin-stdlib-jre8
starting kotlin 1.1.2 JDK below 1.8 is not supported anymore by the kotlin compiler as in 1.1.2 blog post:
The Kotlin compiler now requires JDK 8 to run. You shouldn’t notice any changes, because most other Java development tools such as Gradle and the Android toolchain also require JDK 8, so you almost certainly already have it installed. For code generated by the compiler, Java 1.6 compatibility is still the default, and we have no plans to drop support for generating Java 1.6 compatible bytecode.
In my case, it was because I was running gradle with java 1.7 and it looks like the plugin was compiled only for 1.8:
16:48:42.742 [ERROR] [org.gradle.BuildExceptionReporter] Caused by: org.gradle.api.internal.plugins.PluginApplicationException: Failed to apply plugin [id 'kotlin']
16:48:42.742 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.plugins.DefaultPluginManager.doApply(DefaultPluginManager.java:153)
16:48:42.742 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.plugins.DefaultPluginManager.apply(DefaultPluginManager.java:112)
16:48:42.742 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.applyType(DefaultObjectConfigurationAction.java:113)
16:48:42.742 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.access$200(DefaultObjectConfigurationAction.java:36)
16:48:42.742 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction$3.run(DefaultObjectConfigurationAction.java:80)
16:48:42.742 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.execute(DefaultObjectConfigurationAction.java:136)
16:48:42.742 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.project.AbstractPluginAware.apply(AbstractPluginAware.java:46)
16:48:42.742 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.project.ProjectScript.apply(ProjectScript.java:34)
16:48:42.742 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.Script$apply$1.callCurrent(Unknown Source)
16:48:42.742 [ERROR] [org.gradle.BuildExceptionReporter] at build_4u37tyfuy0k7d4zd8vsk5lx9d.run(build.gradle:17)
16:48:42.743 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:91)
16:48:42.743 [ERROR] [org.gradle.BuildExceptionReporter] ... 63 more
16:48:42.743 [ERROR] [org.gradle.BuildExceptionReporter] Caused by: org.gradle.api.GradleException: Could not generate a proxy class for class org.jetbrains.kotlin.gradle.tasks.KotlinCompile.
16:48:42.743 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.AbstractClassGenerator.generateUnderLock(AbstractClassGenerator.java:201)
16:48:42.743 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.AbstractClassGenerator.generate(AbstractClassGenerator.java:64)
16:48:42.743 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.project.taskfactory.TaskFactory.create(TaskFactory.java:115)
16:48:42.743 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.project.taskfactory.TaskFactory.createTask(TaskFactory.java:77)
16:48:42.743 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory.createTask(AnnotationProcessingTaskFactory.java:101)
16:48:42.743 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.project.taskfactory.DependencyAutoWireTaskFactory.createTask(DependencyAutoWireTaskFactory.java:39)
16:48:42.743 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.DefaultTaskContainer.create(DefaultTaskContainer.java:62)
16:48:42.743 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.DefaultTaskContainer.create(DefaultTaskContainer.java:97)
16:48:42.743 [ERROR] [org.gradle.BuildExceptionReporter] at org.jetbrains.kotlin.gradle.tasks.KotlinTasksProvider.createKotlinJVMTask(TasksProvider.kt:26)
16:48:42.743 [ERROR] [org.gradle.BuildExceptionReporter] at org.jetbrains.kotlin.gradle.plugin.Kotlin2JvmSourceSetProcessor.doCreateTask(KotlinPlugin.kt:111)
16:48:42.744 [ERROR] [org.gradle.BuildExceptionReporter] at org.jetbrains.kotlin.gradle.plugin.Kotlin2JvmSourceSetProcessor.doCreateTask(KotlinPlugin.kt:93)
16:48:42.744 [ERROR] [org.gradle.BuildExceptionReporter] at org.jetbrains.kotlin.gradle.plugin.KotlinSourceSetProcessor.createKotlinCompileTask(KotlinPlugin.kt:83)
16:48:42.744 [ERROR] [org.gradle.BuildExceptionReporter] at org.jetbrains.kotlin.gradle.plugin.KotlinSourceSetProcessor.<init>(KotlinPlugin.kt:56)
16:48:42.744 [ERROR] [org.gradle.BuildExceptionReporter] at org.jetbrains.kotlin.gradle.plugin.Kotlin2JvmSourceSetProcessor.<init>(KotlinPlugin.kt:101)
16:48:42.744 [ERROR] [org.gradle.BuildExceptionReporter] at org.jetbrains.kotlin.gradle.plugin.KotlinPlugin.buildSourceSetProcessor$kotlin_gradle_plugin_main(KotlinPlugin.kt:302)
16:48:42.744 [ERROR] [org.gradle.BuildExceptionReporter] at org.jetbrains.kotlin.gradle.plugin.KotlinPlugin.buildSourceSetProcessor$kotlin_gradle_plugin_main(KotlinPlugin.kt:295)
16:48:42.744 [ERROR] [org.gradle.BuildExceptionReporter] at org.jetbrains.kotlin.gradle.plugin.AbstractKotlinPlugin$configureSourceSetDefaults$1.execute(KotlinPlugin.kt:279)
16:48:42.744 [ERROR] [org.gradle.BuildExceptionReporter] at org.jetbrains.kotlin.gradle.plugin.AbstractKotlinPlugin$configureSourceSetDefaults$1.execute(KotlinPlugin.kt:256)
16:48:42.744 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.DefaultDomainObjectCollection.all(DefaultDomainObjectCollection.java:110)
16:48:42.745 [ERROR] [org.gradle.BuildExceptionReporter] at org.jetbrains.kotlin.gradle.plugin.AbstractKotlinPlugin.configureSourceSetDefaults(KotlinPlugin.kt:278)
16:48:42.745 [ERROR] [org.gradle.BuildExceptionReporter] at org.jetbrains.kotlin.gradle.plugin.AbstractKotlinPlugin.apply(KotlinPlugin.kt:269)
16:48:42.745 [ERROR] [org.gradle.BuildExceptionReporter] at org.jetbrains.kotlin.gradle.plugin.KotlinPlugin.apply(KotlinPlugin.kt:306)
16:48:42.745 [ERROR] [org.gradle.BuildExceptionReporter] at org.jetbrains.kotlin.gradle.plugin.KotlinPlugin.apply(KotlinPlugin.kt:295)
16:48:42.745 [ERROR] [org.gradle.BuildExceptionReporter] at org.jetbrains.kotlin.gradle.plugin.KotlinBasePluginWrapper.apply(KotlinPluginWrapper.kt:46)
16:48:42.745 [ERROR] [org.gradle.BuildExceptionReporter] at org.jetbrains.kotlin.gradle.plugin.KotlinBasePluginWrapper.apply(KotlinPluginWrapper.kt:34)
16:48:42.745 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.plugins.ImperativeOnlyPluginApplicator.applyImperative(ImperativeOnlyPluginApplicator.java:35)
16:48:42.745 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.plugins.RuleBasedPluginApplicator.applyImperative(RuleBasedPluginApplicator.java:43)
16:48:42.745 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.plugins.DefaultPluginManager.doApply(DefaultPluginManager.java:137)
16:48:42.745 [ERROR] [org.gradle.BuildExceptionReporter] ... 73 more
16:48:42.745 [ERROR] [org.gradle.BuildExceptionReporter] Caused by: java.lang.UnsupportedClassVersionError: org/jetbrains/kotlin/cli/common/arguments/K2JVMCompilerArguments : Unsupported major.minor version 52.0
16:48:42.745 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.internal.reflect.ClassInspector.inspectClass(ClassInspector.java:67)
16:48:42.745 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.internal.reflect.ClassInspector.visitGraph(ClassInspector.java:51)
16:48:42.745 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.internal.reflect.ClassInspector.inspect(ClassInspector.java:31)
16:48:42.746 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.AbstractClassGenerator.inspectType(AbstractClassGenerator.java:260)
16:48:42.746 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.AbstractClassGenerator.inspectType(AbstractClassGenerator.java:216)
16:48:42.746 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.AbstractClassGenerator.generateUnderLock(AbstractClassGenerator.java:95)
Related tickets: https://youtrack.jetbrains.com/issue/KT-17866 and https://youtrack.jetbrains.com/issue/KT-17297
If you're still receiving this error despite:
Setting the JAVA_HOME environment variable to your JDK8 installation.
Changing sourceCompatibility in your build.gradle file.
Pointing to JDK8 in your gradle.properties file.
It's possible that you're running an old version of gradle.
I was receiving this error on gradle version 3.2, but upgrading to version 5.1 fixed the error for me.
You can download the latest release from Gradle's Website.
More info here.
Try to add jcenter() repo in buildscript repositories and update kotlin version.
buildscript {
ext.kotlin_version = '1.1.2-4'
repositories {
mavenCentral()
jcenter()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
apply plugin: "kotlin"
repositories {
mavenCentral()
jcenter()
}
dependencies {
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
}
If you're targeting JDK 7 or JDK 8, you can use extended versions of the Kotlin standard library which contain additional extension functions for APIs added in new JDK versions. Instead of kotlin-stdlib, use one of the following dependencies:
compile "org.jetbrains.kotlin:kotlin-stdlib-jre7"
compile "org.jetbrains.kotlin:kotlin-stdlib-jre8"

Gradle sonarqube plugin fails with "Incompatible version 1007" with gradle version 2.13

We recently upgraded our gradle to version 2.13 (the latest at the time of this writing). We are using the sonarqube plugin calling it via "gradlew clean test sonarqube". Before the upgrade, everything was working fine with Sonar.
After we upgraded to version 2.13, we get the following error "Incompatible version 1007" and it looks like an incompatibility with the gradle jacoco plugin. We are currently using version 2.0.1 of the sonarqube plugin and we also tried the sonarRunner plugin as well which fails with the same error. Has anybody else run into this and how did you resolve it?
plugins {
id "org.sonarqube" version "2.0.1"
}
4:06:55.845 [ERROR] [org.gradle.BuildExceptionReporter] Execution failed for task ':sonarqube'.
14:06:55.845 [ERROR] [org.gradle.BuildExceptionReporter] > Unable to read /var/lib/jenkins/jobs/Indicee-BI-API-Java-Library_platform_team/workspace/build/jacoco/test.exec
14:06:55.845 [ERROR] [org.gradle.BuildExceptionReporter]
14:06:55.846 [ERROR] [org.gradle.BuildExceptionReporter] * Exception is:
14:06:55.846 [ERROR] [org.gradle.BuildExceptionReporter] org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':sonarqube'.
14:06:55.852 [ERROR] [org.gradle.BuildExceptionReporter] Caused by: java.io.IOException: Incompatible version 1007.
14:06:55.852 [ERROR] [org.gradle.BuildExceptionReporter] at org.jacoco.core.data.ExecutionDataReader.readHeader(ExecutionDataReader.java:127)
14:06:55.852 [ERROR] [org.gradle.BuildExceptionReporter] at org.jacoco.core.data.ExecutionDataReader.readBlock(ExecutionDataReader.java:107)
14:06:55.852 [ERROR] [org.gradle.BuildExceptionReporter] at org.jacoco.core.data.ExecutionDataReader.read(ExecutionDataReader.java:87)
14:06:55.853 [ERROR] [org.gradle.BuildExceptionReporter] at org.sonar.plugins.jacoco.JaCoCoOverallSensor.loadSourceFiles(JaCoCoOverallSensor.java:124)
14:06:55.853 [ERROR] [org.gradle.BuildExceptionReporter] ... 95 more
The Sonar plugin upgrade for Java to 3.13.1 worked. Thank you.

Spring XD dist task fails when building from a branch

gradlew dist -xtest -xjavadoc -xsetupui
When dist from master, build succeeds.
When running from branch, it fails.I did push the branch to my remote, but I am not sure why the gradle task should know about remote branches. I could run successfully with -xpullDocs
Seems something to do with "wikiBranch" property.
FAILURE: Build failed with an exception.
10:34:14.670 [ERROR] [org.gradle.BuildExceptionReporter]
10:34:14.670 [ERROR] [org.gradle.BuildExceptionReporter] * Where:
10:34:14.670 [ERROR] [org.gradle.BuildExceptionReporter] Script '/Users/{$ID}/spring-xd/gradle/build-docs.gradle' line: 58
10:34:14.670 [ERROR] [org.gradle.BuildExceptionReporter]
10:34:14.670 [ERROR] [org.gradle.BuildExceptionReporter] * What went wrong:
10:34:14.671 [ERROR] [org.gradle.BuildExceptionReporter] Execution failed for task ':pullDocs'.
10:34:14.671 [ERROR] [org.gradle.BuildExceptionReporter] > Error while switching to branch: origin/jms-transport. Cause: Ref origin/{branch} can not be resolved
10:34:14.672 [ERROR] [org.gradle.BuildExceptionReporter]
10:34:14.673 [ERROR] [org.gradle.BuildExceptionReporter] * Exception is:
10:34:14.674 [ERROR] [org.gradle.BuildExceptionReporter] org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':pullDocs'.
10:34:14.674 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:69)
10:34:14.674 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46)
10:34:14.674 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:35)
10:34:14.674 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:64)
10:34:14.674 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
10:34:14.674 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:42)
10:34:14.674 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
10:34:14.675 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:53)
10:34:14.675 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
10:34:14.675 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.AbstractTask.executeWithoutThrowingTaskFailure(AbstractTask.java:289)
10:34:14.675 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.executeTask(AbstractTaskPlanExecutor.java:79)
10:34:14.675 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:63)
10:34:14.675 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:51)
Use -PwikiBranch=origin/master
At present, we maintain the documentation separately from the main sources. We found it initially helpful to use the GitHub wiki (with its editing capabilities) as the source for Spring XD's documentation. Github's wiki is a separate Git repo and cause some complexities.
With multiple active XD branches, we had to maintain multiple documentation branches as well.
Therefore, if you use a custom branch, you have to pass the -PwikiBranch parameter using Gradle, e.g.:
./gradlew dist -PwikiBranch=origin/master
For some more details, please also see:
https://github.com/spring-projects/spring-xd/blob/master/gradle/build-docs.gradle#L37

Resources