修繕
こんにちは、私は今それを働いています。Groovy プラグインが不足していたことが判明しました (Peter に感謝します)。以下の回答を参照してください。参照用に残されている元の投稿。
私たちは grails を初めて使用し、すべて gradle を使用しています。gradle を使用して grails アプリをビルドするために見つけることができる最も単純なケースを試しましたが、どのコマンドを試しても (皮肉なことに、機能したが役に立たなかった「createWrapper」を除く)、次のようになります。
$グラドルテスト 動的プロパティは非推奨です: http://gradle.org/docs/current/dsl/org.gradle.api.plugins.ExtraPropertiesExtension.html 非推奨の動的プロパティ: "ルート プロジェクト 'IMPACT'" の "grailsVersion"、値: "2.0.4"。 :テスト FAILURE: ビルドは例外で失敗しました。 * 何が悪かったのか: タスク ':test' の実行に失敗しました。 > Groovy/言語/GroovyObject * 試す: --stacktrace オプションを指定して実行し、スタック トレースを取得します。--info または --debug オプションを指定して実行し、より多くのログ出力を取得します。 ビルドに失敗しました 合計時間: 4.867 秒
どのコマンドを使用しても違いはありません。出力は常に同じです。
Gradle build.gradle ファイルは次のとおりです。
ext.grailsVersion = '2.0.4'
task createWrapper(type: Wrapper) {
gradleVersion = '1.0'
}
buildscript {
repositories {
maven {
url 'http://repo.grails.org/grails/core/'
}
}
dependencies {
classpath 'org.grails:grails-gradle-plugin:1.1.1-SNAPSHOT',
"org.grails:grails-bootstrap:2.0.4"
}
}
apply plugin: 'groovy'
apply plugin: 'grails'
repositories {
mavenCentral()
maven { url 'http://repo.grails.org/grails/core/' }
maven { url 'http://repo.grails.org/grails/plugins/' }
}
dependencies {
compile "org.grails:grails:2.0.4",
"org.grails:grails-core:2.0.4",
"org.grails:grails-hibernate:2.0.4",
"org.grails:grails-logging:2.0.4",
"org.grails:grails-plugin-controllers:2.0.4",
"org.grails:grails-plugin-services:2.0.4",
"org.grails:grails-plugin-domain-class:2.0.4",
"org.grails:grails-plugin-datasource:2.0.4",
"org.grails:grails-plugin-i18n:2.0.4",
"org.grails:grails-spring:2.0.4",
"org.grails.plugins:spring-security-core:1.2.7.3",
"org.grails.plugins:spring-security-ldap:1.0.6"
}
環境: JDK 1.7.0_05、groovy 1.8.6、grails 2.0.4、gradle 1.0、Mac Os X 10.7.4。
スタックトレース:
> $ gradle --stacktrace テスト :テスト > > FAILURE: ビルドが例外で失敗しました。 > > * 問題: タスク ':test' の実行に失敗しました。 > > Groovy/言語/GroovyObject > > * 試してください: --info または --debug オプションを指定して実行し、より多くのログ出力を取得してください。 > > * 例外は: > > org.gradle.api.tasks.TaskExecutionException: タスクの実行に失敗しました > ':テスト'. で > org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:68) >で > org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46) >で > org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:34) >で > org.gradle.api.internal.changedetection.CacheLockHandlingTaskExecuter$1.run(CacheLockHandlingTaskExecuter.java:34) >で > org.gradle.cache.internal.DefaultCacheAccess$2.create(DefaultCacheAccess.java:200) >で > org.gradle.cache.internal.DefaultCacheAccess.longRunningOperation(DefaultCacheAccess.java:172) >で > org.gradle.cache.internal.DefaultCacheAccess.longRunningOperation(DefaultCacheAccess.java:198) >で > org.gradle.cache.internal.DefaultPersistentDirectoryStore.longRunningOperation(DefaultPersistentDirectoryStore.java:111) >で > org.gradle.api.internal.changedetection.DefaultTaskArtifactStateCacheAccess.longRunningOperation(DefaultTaskArtifactStateCacheAccess.java:83) >で > org.gradle.api.internal.changedetection.CacheLockHandlingTaskExecuter.execute(CacheLockHandlingTaskExecuter.java:32) >で > org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:55) >で > org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:57) >で > org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:41) >で > org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:51) >で > org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:52) >で > org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:42) >で > org.gradle.api.internal.AbstractTask.executeWithoutThrowingTaskFailure(AbstractTask.java:247) >で > org.gradle.execution.DefaultTaskGraphExecuter.executeTask(DefaultTaskGraphExecuter.java:192) >で > org.gradle.execution.DefaultTaskGraphExecuter.doExecute(DefaultTaskGraphExecuter.java:177) >で > org.gradle.execution.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:83) >で > org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:36) >で > org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:61) >で > org.gradle.execution.DefaultBuildExecuter.access$200(DefaultBuildExecuter.java:23) >で > org.gradle.execution.DefaultBuildExecuter$2.proceed(DefaultBuildExecuter.java:67) >で > org.gradle.api.internal.changedetection.TaskCacheLockHandlingBuildExecuter$1.run(TaskCacheLockHandlingBuildExecuter.java:31) >で > org.gradle.cache.internal.DefaultCacheAccess$1.create(DefaultCacheAccess.java:111) >で > org.gradle.cache.internal.DefaultCacheAccess.useCache(DefaultCacheAccess.java:126) >で > org.gradle.cache.internal.DefaultCacheAccess.useCache(DefaultCacheAccess.java:109) >で > org.gradle.cache.internal.DefaultPersistentDirectoryStore.useCache(DefaultPersistentDirectoryStore.java:103) >で > org.gradle.api.internal.changedetection.DefaultTaskArtifactStateCacheAccess.useCache(DefaultTaskArtifactStateCacheAccess.java:79) >で > org.gradle.api.internal.changedetection.TaskCacheLockHandlingBuildExecuter.execute(TaskCacheLockHandlingBuildExecuter.java:29) >で > org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:61) >で > org.gradle.execution.DefaultBuildExecuter.access$200(DefaultBuildExecuter.java:23) >で > org.gradle.execution.DefaultBuildExecuter$2.proceed(DefaultBuildExecuter.java:67) >で > org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32) >で > org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:61) >で > org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:54) >で > org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:155) >で > org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:110) >で > org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:78) >で > org.gradle.launcher.cli.RunBuildAction.execute(RunBuildAction.java:42) >で > org.gradle.launcher.cli.RunBuildAction.execute(RunBuildAction.java:28) >で > org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:201) >で > org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:174) >で > org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:170) >で > org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:139) >で > org.gradle.launcher.exec.ExceptionReportingAction.execute(ExceptionReportingAction.java:31) >で > org.gradle.launcher.exec.ExceptionReportingAction.execute(ExceptionReportingAction.java:20) > org.gradle.launcher.Main.doAction(Main.java:48) で > org.gradle.launcher.exec.EntryPoint.run(EntryPoint.java:45) で > org.gradle.launcher.Main.main(Main.java:39) で > org.gradle.launcher.ProcessBootstrap.runNoExit(ProcessBootstrap.java:50) > org.gradle.launcher.ProcessBootstrap.run(ProcessBootstrap.java:32) で > org.gradle.launcher.GradleMain.main(GradleMain.java:24) で > java.lang.NoClassDefFoundError: groovy/lang/GroovyObject で > org.grails.launcher.RootLoader.oldFindClass(RootLoader.java:143) で > org.grails.launcher.RootLoader.loadClass(RootLoader.java:115) で > org.grails.launcher.GrailsLauncher.(GrailsLauncher.java:70) で > org.grails.gradle.plugin.GrailsTask.createLauncher(GrailsTask.groovy:107) >で > org.grails.gradle.plugin.GrailsTask.executeCommand(GrailsTask.groovy:56) >で > org.gradle.api.internal.BeanDynamicObject$MetaClassAdapter.invokeMethod(BeanDynamicObject.java:196) >で > org.gradle.api.internal.BeanDynamicObject.invokeMethod(BeanDynamicObject.java:102) >で > org.gradle.api.internal.CompositeDynamicObject.invokeMethod(CompositeDynamicObject.java:99) > org.grails.gradle.plugin.GrailsTask_Decorated.invokeMethod(不明) >出典) > org.gradle.util.ReflectionUtil.invoke(ReflectionUtil.groovy:23) で > org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$4.execute(AnnotationProcessingTaskFactory.java:150) >で > org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$4.execute(AnnotationProcessingTaskFactory.java:145) >で > org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:477) >で > org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:466) >で > org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:60) > ... 53 以上 原因: java.lang.ClassNotFoundException: > groovy.lang.GroovyObject at > org.grails.launcher.RootLoader.findClass(RootLoader.java:147) で > org.grails.launcher.RootLoader.loadClass(RootLoader.java:119) ... 68 > もっと > > > ビルドに失敗しました > > 合計時間: 5.534 秒
ポインタやコメントは大歓迎です。
--debug 出力のスニペット:
09:17:15.191 [ERROR] [org.gradle.BuildExceptionReporter] Caused by: java.lang.NoClassDefFoundError: groovy/lang/GroovyObject
09:17:15.191 [ERROR] [org.gradle.BuildExceptionReporter] at org.grails.launcher.RootLoader.oldFindClass(RootLoader.java:143)
09:17:15.192 [ERROR] [org.gradle.BuildExceptionReporter] at org.grails.launcher.RootLoader.loadClass(RootLoader.java:115)
09:17:15.192 [ERROR] [org.gradle.BuildExceptionReporter] at org.grails.launcher.GrailsLauncher.<init>(GrailsLauncher.java:70)
09:17:15.192 [ERROR] [org.gradle.BuildExceptionReporter] at org.grails.gradle.plugin.GrailsTask.createLauncher(GrailsTask.groovy:107)
09:17:15.192 [ERROR] [org.gradle.BuildExceptionReporter] at org.grails.gradle.plugin.GrailsTask.executeCommand(GrailsTask.groovy:56)
09:17:15.192 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.BeanDynamicObject$MetaClassAdapter.invokeMethod(BeanDynamicObject.java:196)
09:17:15.193 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.BeanDynamicObject.invokeMethod(BeanDynamicObject.java:102)
09:17:15.193 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.CompositeDynamicObject.invokeMethod(CompositeDynamicObject.java:99)
09:17:15.193 [ERROR] [org.gradle.BuildExceptionReporter] at org.grails.gradle.plugin.GrailsTask_Decorated.invokeMethod(Unknown Source)
09:17:15.193 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.util.ReflectionUtil.invoke(ReflectionUtil.groovy:23)
09:17:15.193 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$4.execute(AnnotationProcessingTaskFactory.java:150)
09:17:15.193 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$4.execute(AnnotationProcessingTaskFactory.java:145)
09:17:15.193 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:477)
09:17:15.194 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:466)
09:17:15.194 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:60)
09:17:15.194 [ERROR] [org.gradle.BuildExceptionReporter] ... 53 more
09:17:15.194 [ERROR] [org.gradle.BuildExceptionReporter] Caused by: java.lang.ClassNotFoundException: groovy.lang.GroovyObject
09:17:15.194 [ERROR] [org.gradle.BuildExceptionReporter] at org.grails.launcher.RootLoader.findClass(RootLoader.java:147)
09:17:15.194 [ERROR] [org.gradle.BuildExceptionReporter] at org.grails.launcher.RootLoader.loadClass(RootLoader.java:119)
09:17:15.194 [ERROR] [org.gradle.BuildExceptionReporter] ... 68 more
09:17:15.194 [ERROR] [org.gradle.BuildExceptionReporter]
09:17:15.195 [LIFECYCLE] [org.gradle.BuildResultLogger]
09:17:15.195 [LIFECYCLE] [org.gradle.BuildResultLogger] BUILD FAILED