Plugin broken with gradle 3.4.1
erhan14 opened this issue · comments
I upgraded my wrapper to gradle 3.4.1 from 3.1 and the project started to give the following error during project configuration phase. id "edu.sc.seis.launch4j" version "2.3.0"
**Caused by: java.lang.NoClassDefFoundError: org/gradle/api/plugins/JavaPlugin
at edu.sc.seis.launch4j.Launch4jPluginExtension.afterEvaluate(Launch4jPluginExtension.groovy:109)**
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':ECR_GMP3_SIMULATOR'.
> Failed to notify project evaluation listener.
> org/gradle/api/plugins/JavaPlugin
* Try:
Run with --debug option to get more log output.
* Exception is:
org.gradle.api.ProjectConfigurationException: A problem occurred configuring project ':ECR_GMP3_SIMULATOR'.
at org.gradle.configuration.project.LifecycleProjectEvaluator.addConfigurationFailure(LifecycleProjectEvaluator.java:94)
at org.gradle.configuration.project.LifecycleProjectEvaluator.notifyAfterEvaluate(LifecycleProjectEvaluator.java:89)
at org.gradle.configuration.project.LifecycleProjectEvaluator.doConfigure(LifecycleProjectEvaluator.java:76)
at org.gradle.configuration.project.LifecycleProjectEvaluator.access$000(LifecycleProjectEvaluator.java:33)
at org.gradle.configuration.project.LifecycleProjectEvaluator$1.execute(LifecycleProjectEvaluator.java:53)
at org.gradle.configuration.project.LifecycleProjectEvaluator$1.execute(LifecycleProjectEvaluator.java:50)
at org.gradle.internal.Transformers$4.transform(Transformers.java:169)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:106)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:61)
at org.gradle.configuration.project.LifecycleProjectEvaluator.evaluate(LifecycleProjectEvaluator.java:50)
at org.gradle.api.internal.project.DefaultProject.evaluate(DefaultProject.java:599)
at org.gradle.api.internal.project.DefaultProject.evaluate(DefaultProject.java:125)
at org.gradle.execution.TaskPathProjectEvaluator.configure(TaskPathProjectEvaluator.java:35)
at org.gradle.execution.TaskPathProjectEvaluator.configureHierarchy(TaskPathProjectEvaluator.java:62)
at org.gradle.configuration.DefaultBuildConfigurer.configure(DefaultBuildConfigurer.java:38)
at org.gradle.initialization.DefaultGradleLauncher$ConfigureBuildAction.execute(DefaultGradleLauncher.java:233)
at org.gradle.initialization.DefaultGradleLauncher$ConfigureBuildAction.execute(DefaultGradleLauncher.java:230)
at org.gradle.internal.Transformers$4.transform(Transformers.java:169)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:106)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:56)
at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:160)
at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:119)
at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:102)
at org.gradle.launcher.exec.GradleBuildController.run(GradleBuildController.java:71)
at org.gradle.tooling.internal.provider.ExecuteBuildActionRunner.run(ExecuteBuildActionRunner.java:28)
at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:41)
at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:26)
at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:75)
at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:49)
at org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:49)
at org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:31)
at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:67)
at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:47)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:26)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
at org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon.execute(RequestStopIfSingleUsedDaemon.java:34)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:74)
at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:72)
at org.gradle.util.Swapper.swap(Swapper.java:38)
at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:72)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
at org.gradle.launcher.daemon.server.exec.LogAndCheckHealth.execute(LogAndCheckHealth.java:55)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:60)
at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:72)
at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:50)
at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.java:297)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:46)
Caused by: org.gradle.internal.event.ListenerNotificationException: Failed to notify project evaluation listener.
at org.gradle.internal.event.AbstractBroadcastDispatch.dispatch(AbstractBroadcastDispatch.java:55)
at org.gradle.internal.event.BroadcastDispatch.dispatch(BroadcastDispatch.java:79)
at org.gradle.internal.event.BroadcastDispatch.dispatch(BroadcastDispatch.java:30)
at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93)
at com.sun.proxy.$Proxy16.afterEvaluate(Unknown Source)
at org.gradle.configuration.project.LifecycleProjectEvaluator.notifyAfterEvaluate(LifecycleProjectEvaluator.java:82)
... 56 more
Caused by: java.lang.NoClassDefFoundError: org/gradle/api/plugins/JavaPlugin
at edu.sc.seis.launch4j.Launch4jPluginExtension.afterEvaluate(Launch4jPluginExtension.groovy:109)
at edu.sc.seis.launch4j.Launch4jPluginExtension$afterEvaluate.call(Unknown Source)
at edu.sc.seis.launch4j.Launch4jPlugin$_apply_closure1.doCall(Launch4jPlugin.groovy:55)
at org.gradle.listener.ClosureBackedMethodInvocationDispatch.dispatch(ClosureBackedMethodInvocationDispatch.java:40)
at org.gradle.listener.ClosureBackedMethodInvocationDispatch.dispatch(ClosureBackedMethodInvocationDispatch.java:25)
at org.gradle.internal.event.AbstractBroadcastDispatch.dispatch(AbstractBroadcastDispatch.java:44)
... 61 more
I can't reproduce your issue. Could you provide a short example or repo link which does not work for you.
There is a root project and a sub project. I have the launch4j task in the sub project which is called before distTar
distTar.dependsOn "launch4j"
Attached is the sample project. Just cd into the "ECR_MANAGER\ECR_GMP3_SIMULATOR" folder and call ..\gradlew distTar to see the following error :
- Exception is:
java.lang.NoClassDefFoundError: org/gradle/api/plugins/JavaPlugin
at edu.sc.seis.launch4j.Launch4jPluginExtension.internalJar(Launch4jPluginExtension.groovy:153)
at edu.sc.seis.launch4j.Launch4jPluginExtension$internalJar.call(Unknown Source)
I'm unable to reproduce your issue with your sample project:
/g/issue54/ECR_MANAGER/ECR_GMP3_SIMULATOR $ ../gradlew distTar
Parallel execution is an incubating feature.
Building ECR_FISCAL jar!
ECR_MANAGER Building jar!
Building ECR_MANAGER Tar!
Building ECR_UTILITY jar!
launch4j.opt property is deprecated. Use launch4j.jvmOptions instead.
:ECR_UTILITY:compileJava
:ECR_FISCAL:processResources
:ECR_MANAGER:processResources
:ECR_FISCAL:processResources NO-SOURCE
:ECR_MANAGER:processResources NO-SOURCE
:ECR_GMP3_SIMULATOR:processResources
:ECR_UTILITY:compileJava NO-SOURCE
:ECR_UTILITY:copyMsgRes
:ECR_GMP3_SIMULATOR:processResources NO-SOURCE
:ECR_UTILITY:copyMsgRes NO-SOURCE
:ECR_UTILITY:processResources NO-SOURCE
:ECR_UTILITY:classes UP-TO-DATE
:ECR_UTILITY:jar UP-TO-DATE
:ECR_MANAGER:compileJava NO-SOURCE
:ECR_MANAGER:classes UP-TO-DATE
:ECR_MANAGER:jar UP-TO-DATE
:ECR_FISCAL:compileJava NO-SOURCE
:ECR_FISCAL:compileGroovy NO-SOURCE
:ECR_FISCAL:classes UP-TO-DATE
:ECR_FISCAL:jar UP-TO-DATE
:ECR_GMP3_SIMULATOR:compileJava NO-SOURCE
:ECR_GMP3_SIMULATOR:classes UP-TO-DATE
:ECR_GMP3_SIMULATOR:jar
Configuring child specs of a copy task at execution time of the task has been deprecated and is scheduled to be removed in Gradle 4.0. Consider configuring the spec during configuration time, or using a separate task to do the configuration.
at build_7sf0yh57k7kxhfimszjxsqs0r$_run_closure11.doCall(/g/issue54/ECR_MANAGER/ECR_GMP3_SIMULATOR/build.gradle:120)
:ECR_GMP3_SIMULATOR:createExe
:ECR_GMP3_SIMULATOR:launch4j
The `launch4j` task is deprecated. Use the `createExe` task instead
:ECR_GMP3_SIMULATOR:proguard FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':ECR_GMP3_SIMULATOR:proguard'.
> java.io.IOException: The input doesn't contain any classes. Did you specify the proper '-injars' options?
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 5.16 secs
And from vagrant the same
Building ECR_FISCAL jar!
ECR_MANAGER Building jar!
Building ECR_MANAGER Tar!
Building ECR_UTILITY jar!
launch4j.opt property is deprecated. Use launch4j.jvmOptions instead.
:ECR_UTILITY:compileJava NO-SOURCE
:ECR_UTILITY:copyMsgRes NO-SOURCE
:ECR_UTILITY:processResources NO-SOURCE
:ECR_UTILITY:classes UP-TO-DATE
:ECR_UTILITY:jar
:ECR_MANAGER:compileJava NO-SOURCE
:ECR_MANAGER:processResources NO-SOURCE
:ECR_MANAGER:classes UP-TO-DATE
:ECR_MANAGER:jar
:ECR_FISCAL:compileJava NO-SOURCE
:ECR_FISCAL:compileGroovy NO-SOURCE
:ECR_FISCAL:processResources NO-SOURCE
:ECR_FISCAL:classes UP-TO-DATE
:ECR_FISCAL:jar
:ECR_GMP3_SIMULATOR:compileJava NO-SOURCE
:ECR_GMP3_SIMULATOR:processResources NO-SOURCE
:ECR_GMP3_SIMULATOR:classes UP-TO-DATE
:ECR_GMP3_SIMULATOR:jar
Configuring child specs of a copy task at execution time of the task has been deprecated and is scheduled to be removed in Gradle 4.0. Consider configuring the spec during configuration time, or using a separate task to do the configuration.
at build_8i0od5cvgyddym82w2aibzz7h$_run_closure12.doCall(/vagrant/issue54/ECR_MANAGER/ECR_GMP3_SIMULATOR/build.gradle:125)
:ECR_GMP3_SIMULATOR:createExe
:ECR_GMP3_SIMULATOR:launch4j
The `launch4j` task is deprecated. Use the `createExe` task instead
:ECR_GMP3_SIMULATOR:proguard FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':ECR_GMP3_SIMULATOR:proguard'.
> java.io.IOException: The input doesn't contain any classes. Did you specify the proper '-injars' options?
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 3.154 secs
Can you try with this?
That works for me, too.
Could you "reinstall" your gradle 4.3.1 because the exception java.lang.NoClassDefFoundError: org/gradle/api/plugins/JavaPlugin
should not happen on - I don't know, but like - any gradle version. So it could be just a faulty unzip or whatever...
@erhan14 You haven't commented here for a while. How have you worked around your issue?
After removing gradle folder the issue seems to disappear. Thanks