プロジェクトをGroovy 2.4。*からGroovy 2.5.0にアップグレードすると、Gradleを使用してコンパイルすると、org/codehaus/groovy/ast/methodcalltransformationにnoclassdeffounderrorが発生します。
Groovy 2.4では問題なく動作します。
ここに例外全体を投稿します:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':compileGroovy'.
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.Java:100)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.Java:70)
at org.gradle.api.internal.tasks.execution.OutputDirectoryCreatingTaskExecuter.execute(OutputDirectoryCreatingTaskExecuter.Java:51)
at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.Java:62)
at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.Java:54)
at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.Java:60)
at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.Java:97)
at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.Java:87)
at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.Java:52)
at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.Java:52)
at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.Java:54)
at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.Java:43)
at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.Java:34)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.run(DefaultTaskGraphExecuter.Java:248)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.Java:336)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.Java:328)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.Java:199)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.Java:110)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.Java:241)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.Java:230)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.processTask(DefaultTaskPlanExecutor.Java:123)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.access$200(DefaultTaskPlanExecutor.Java:79)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.Java:104)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.Java:98)
at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.execute(DefaultTaskExecutionPlan.Java:626)
at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.executeWithTask(DefaultTaskExecutionPlan.Java:581)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.run(DefaultTaskPlanExecutor.Java:98)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.Java:63)
at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.Java:46)
at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.Java:55)
Caused by: Java.lang.NoClassDefFoundError: org/codehaus/groovy/ast/MethodCallTransformation
at org.gradle.api.internal.tasks.compile.ApiGroovyCompiler$1.<init>(ApiGroovyCompiler.Java:117)
at org.gradle.api.internal.tasks.compile.ApiGroovyCompiler.execute(ApiGroovyCompiler.Java:117)
at org.gradle.api.internal.tasks.compile.ApiGroovyCompiler.execute(ApiGroovyCompiler.Java:56)
at org.gradle.api.internal.tasks.compile.daemon.AbstractDaemonCompiler$CompilerRunnable.run(AbstractDaemonCompiler.Java:87)
at org.gradle.workers.internal.DefaultWorkerServer.execute(DefaultWorkerServer.Java:36)
at org.gradle.workers.internal.WorkerDaemonServer.execute(WorkerDaemonServer.Java:46)
at org.gradle.workers.internal.WorkerDaemonServer.execute(WorkerDaemonServer.Java:30)
at org.gradle.process.internal.worker.request.WorkerAction.run(WorkerAction.Java:100)
at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.Java:35)
at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.Java:24)
at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.Java:146)
at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.Java:128)
at org.gradle.internal.remote.internal.hub.MessageHub$Handler.run(MessageHub.Java:404)
... 3 more
Caused by: Java.lang.ClassNotFoundException: org.codehaus.groovy.ast.MethodCallTransformation
... 16 more
spring Bootも使用した場合は、次の回避策が役立つかもしれません
参照: spring-boot issue#13444:Groovy 2.5の使用を許可
Gradle 4.8とSpring Boot 1.5.14を使用しましたが、Groovyを2.4.15から2.5.0にアップグレードした後も同じNoClassDefFoundErrorが発生しました。
問題が示唆することを行った後、それは正常にビルドされ、うまく動作します、
追加 io.spring.dependency-management
プラグインbuild.gradle
(私は自分でSpring Boot 1.5を使用していますが、Spring Boot 2もうまく機能するはずです)
plugins {
id 'org.springframework.boot' version '1.5.14.RELEASE'
id 'io.spring.dependency-management' version '1.0.5.RELEASE'
}
セットする groovy.version
から2.5.0
ext['groovy.version'] = '2.5.0'
groovy 2.5をビルドしてお楽しみください! :)