Hi everyone,
I’m trying add the checkstyle plugin. It seems that it can’t load the configuration file; I’m using this exact same configuration file in ant directly. Any ideas? I’m using Gradle 2.6
Stacktrace:
Caused by: : Unable to create a Checker: null
at com.puppycrawl.tools.checkstyle.CheckStyleTask.createChecker(CheckStyleTask.java:362)
at com.puppycrawl.tools.checkstyle.CheckStyleTask.realExecute(CheckStyleTask.java:280)
at com.puppycrawl.tools.checkstyle.CheckStyleTask.execute(CheckStyleTask.java:243)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.gradle.api.internal.project.ant.BasicAntBuilder.nodeCompleted(BasicAntBuilder.java:77)
at org.gradle.api.internal.project.AntBuilderDelegate.nodeCompleted(DefaultIsolatedAntBuilder.groovy:177)
at org.gradle.api.plugins.quality.Checkstyle$_run_closure1.doCall(Checkstyle.groovy:142)
at org.gradle.api.internal.ClosureBackedAction.execute(ClosureBackedAction.java:67)
at org.gradle.util.ConfigureUtil.configure(ConfigureUtil.java:130)
at org.gradle.util.ConfigureUtil.configure(ConfigureUtil.java:91)
at org.gradle.util.ConfigureUtil$configure.call(Unknown Source)
at org.gradle.api.internal.project.DefaultIsolatedAntBuilder.execute(DefaultIsolatedAntBuilder.groovy:108)
at org.gradle.api.internal.project.IsolatedAntBuilder$execute$0.call(Unknown Source)
at org.gradle.api.plugins.quality.Checkstyle.run(Checkstyle.groovy:139)
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)
... 14 more
Caused by: java.lang.NullPointerException
at com.puppycrawl.tools.checkstyle.api.AutomaticBean.configure(AutomaticBean.java:128)
at com.puppycrawl.tools.checkstyle.CheckStyleTask.createChecker(CheckStyleTask.java:353)
Config:
checkstyle {
toolVersion '6.7' //We can't go above this until Gradle 2.7 https://issues.gradle.org/browse/GRADLE-3314
configFile project.rootProject.file('checkstylefilter.xml')
ignoreFailures true
showViolations false
}