We’re having issues running Grails 3 applications without our custom Gradle distribution. The main point of our distribution is to configure internal repositories and plugins. I using Grails 3.0.4. The custom distro is built on Gradle 2.5.
Snippets from the Grails failure:
$ grails war --stacktrace
...
* What went wrong:
Execution failed for task ':findMainClass'.
> groovyjarjarasm.asm.Type.getMethodType(Lgroovyjarjarasm/asm/Type;[Lgroovyjarjarasm/asm/Type;)Lgroovyjarjarasm/asm/Type;
Caused by: java.lang.NoClassDefFoundError: Could not initialize class org.grails.io.support.MainClassFinder
at org.grails.gradle.plugin.run.FindMainClassTask.createMainClassFinder(FindMainClassTask.groovy:61)
at org.grails.gradle.plugin.run.FindMainClassTask.findMainClass(FindMainClassTask.groovy:51)
at org.grails.gradle.plugin.run.FindMainClassTask.setMainClassProperty(FindMainClassTask.groovy:25)
at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:75)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.doExecute(AnnotationProcessingTaskFactory.java:226)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:219)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:208)
at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:585)
at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:568)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61)
... 69 more
I’ve isolated the following in our init.d scripts:
dependencies {
classpath 'com.mutualofomaha:gradle-plugins:3.+'
}
If I remove that, the grails command runs.
With the distribution in place, I get the following versions. I thought it might be a groovy version problem, but it doesn’t appear so. The groovyjarjarasm.asm.Type class looks identical between groovy 2.3.10 and 2.4.4.
$ ./gradlew --version
------------------------------------------------------------
Gradle 2.5
------------------------------------------------------------
Build time: 2015-07-08 07:38:37 UTC
Build number: none
Revision: 093765bccd3ee722ed5310583e5ed140688a8c2b
Groovy: 2.3.10
Ant: Apache Ant(TM) version 1.9.3 compiled on December 23 2013
JVM: 1.7.0_40 (Oracle Corporation 24.0-b56)
OS: Windows 7 6.1 amd64
$ grails --version
|Grails Version: 3.0.4
|Groovy Version: 2.4.4
|JVM Version: 1.7.0_40