I am trying to run compileJava default task with a huge amount of code. My build.gradle is stil under construction and looks like this:
apply plugin: 'groovy'
apply plugin: 'java'
// Default configuration profile.
//defaultConfigProperty("conf", "build")
println "Using configuration profile stored in $rootProject.projectDir/buildProperties.groovy"
apply from: "$rootProject.projectDir/buildProperties.groovy"
repositories {
mavenCentral()
maven {
url 'http://repo.spring.io/snapshot'
}
}
sourceSets {
test {
java {
srcDir 'test/java/integration'
}
java {
srcDir 'test/java/unit'
}
groovy {
srcDir 'test/groovy/acceptance'
}
resources {
srcDir 'test/resources'
}
}
main {
java {
srcDir 'src'
}
}
}
dependencies {
def jodaTimeVersion = "2.3"
def springVersion = "3.2.9.RELEASE"
def springLdapVersion = "1.3.1.RELEASE"
def springSecurityVersion = "3.1.0.RELEASE"
def springSecurityKerberosVersion = "1.0.0.CI-SNAPSHOT"
def springSecuritySamlVersion = "1.0.0.RELEASE"
def hibernateVersion = "4.1.12.Final"
def hibernateJpaVersion = "1.0.1.Final"
def hibernateCommonsAnnotationsVersion = "4.0.5.Final"
def jsonVersion = "20141113"
def jacksonVersion = "2.4.2"
def commonsFileUploadVersion = "1.2.2"
def dozerVersion = "5.3.2.kv.2"
def oauthVersion = "20100527"
def oauthProviderVersion = "20100527"
def slf4jVersion = "1.6.1"
def log4jVersion = "2.0.2"
// Groovy tests
compile 'com.jayway.restassured:rest-assured:2.3.1', {
exclude group: 'org.codehaus.groovy'
}
compile 'org.codehaus.groovy:groovy-all:2.3.0'
// Date & Time
compile "joda-time:joda-time:$jodaTimeVersion"
// Spring Framework
compile 'org.springframework:spring-aop:3.2.9.RELEASE'
compile 'org.springframework:spring-aspects:3.2.9.RELEASE'
compile 'org.springframework:spring-beans:3.2.9.RELEASE'
compile 'org.springframework:spring-context:3.2.9.RELEASE'
compile 'org.springframework:spring-context-support:3.2.9.RELEASE'
compile 'org.springframework:spring-core:3.2.9.RELEASE'
compile 'org.springframework:spring-expression:3.2.9.RELEASE'
compile 'org.springframework:spring-instrument:3.2.9.RELEASE'
compile 'org.springframework:spring-instrument-tomcat:3.2.9.RELEASE'
compile 'org.springframework:spring-jdbc:3.2.9.RELEASE'
compile 'org.springframework:spring-orm:3.2.9.RELEASE'
compile 'org.springframework:spring-tx:3.2.9.RELEASE'
compile 'org.springframework:spring-web:3.2.9.RELEASE'
compile 'org.springframework:spring-webmvc:3.2.9.RELEASE'
compile 'org.springframework:spring-test:3.2.9.RELEASE'
compile "org.springframework.ldap:spring-ldap-core:$springLdapVersion"
// Spring Security
compile "org.springframework.security:spring-security-core:$springSecurityVersion"
compile "org.springframework.security:spring-security-config:$springSecurityVersion"
compile "org.springframework.security:spring-security-web:$springSecurityVersion"
compile "org.springframework.security:spring-security-ldap:$springSecurityVersion"
compile "org.springframework.security.kerberos:spring-security-kerberos-core:$springSecurityKerberosVersion"
compile "org.springframework.security.extensions:spring-security-saml2-core:$springSecuritySamlVersion"
// Hibernate
compile "org.hibernate:hibernate-core:$hibernateVersion"
compile "org.hibernate.javax.persistence:hibernate-jpa-2.0-api:$hibernateJpaVersion"
compile "org.hibernate.common:hibernate-commons-annotations:$hibernateCommonsAnnotationsVersion"
// Json & Jackson
compile "org.json:json:$jsonVersion"
compile "com.fasterxml.jackson.core:jackson-core:$jacksonVersion"
compile "com.fasterxml.jackson.core:jackson-annotations:$jacksonVersion"
compile "com.fasterxml.jackson.core:jackson-databind:$jacksonVersion"
compile "com.fasterxml.jackson.jaxrs:jackson-jaxrs-base:$jacksonVersion"
compile "com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:$jacksonVersion"
// Apache Commons
compile "commons-fileupload:commons-fileupload:$commonsFileUploadVersion"
// OAuth
compile "net.oauth.core:oauth:$oauthVersion"
compile "net.oauth.core:oauth:$oauthProviderVersion"
// Logging
compile "org.slf4j:slf4j-api:$slf4jVersion"
compile "org.slf4j:slf4j-simple:$slf4jVersion"
compile "org.apache.logging.log4j:log4j-core:$log4jVersion"
compile "org.apache.logging.log4j:log4j-slf4j-impl:$log4jVersion"
compile "org.apache.logging.log4j:log4j-api:$log4jVersion"
// Jar files
compile files("$rootProject.projectDir/gradle-lib/dozer-${dozerVersion}.jar")
testCompile 'junit:junit:4.11'
}
def defaultConfigProperty(key, defaultValue) {
if (!project.ext.getProperties().containsKey(key)) {
project.ext.setProperty(key, defaultValue)
}
}
If I remove the sourceset main/java then no error at all. What I do it is just running:
gradle compileJava or build
and get this:
16:39:52.339 [DEBUG] [org.gradle.execution.taskgraph.AbstractTaskPlanExecutor] Task worker [Thread[main,5,main]] finished, busy: 4.405 secs, idle: 0.002 secs
16:39:52.344 [ERROR] [org.gradle.BuildExceptionReporter]
16:39:52.345 [ERROR] [org.gradle.BuildExceptionReporter] FAILURE: Build failed with an exception.
16:39:52.345 [ERROR] [org.gradle.BuildExceptionReporter]
16:39:52.345 [ERROR] [org.gradle.BuildExceptionReporter] * What went wrong:
16:39:52.346 [ERROR] [org.gradle.BuildExceptionReporter] Execution failed for task ':compileJava'.
16:39:52.346 [ERROR] [org.gradle.BuildExceptionReporter] > java.lang.NullPointerException: Plugin annotation is null.
16:39:52.346 [ERROR] [org.gradle.BuildExceptionReporter]
16:39:52.347 [ERROR] [org.gradle.BuildExceptionReporter] * Exception is:
16:39:52.348 [ERROR] [org.gradle.BuildExceptionReporter] org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':compileJava'.
16:39:52.348 [ERROR] [org.gradle.BuildExceptionReporter]
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:69)
16:39:52.348 [ERROR] [org.gradle.BuildExceptionReporter]
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46)
16:39:52.348 [ERROR] [org.gradle.BuildExceptionReporter]
at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:35)
16:39:52.349 [ERROR] [org.gradle.BuildExceptionReporter]
at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:64)
16:39:52.349 [ERROR] [org.gradle.BuildExceptionReporter]
at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
16:39:52.349 [ERROR] [org.gradle.BuildExceptionReporter]
at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:42)
16:39:52.349 [ERROR] [org.gradle.BuildExceptionReporter]
at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
16:39:52.350 [ERROR] [org.gradle.BuildExceptionReporter]
at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:53)
16:39:52.350 [ERROR] [org.gradle.BuildExceptionReporter]
at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
16:39:52.350 [ERROR] [org.gradle.BuildExceptionReporter]
at org.gradle.api.internal.AbstractTask.executeWithoutThrowingTaskFailure(AbstractTask.java:305)
16:39:52.350 [ERROR] [org.gradle.BuildExceptionReporter]
at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.executeTask(AbstractTaskPlanExecutor.java:79)
16:39:52.350 [ERROR] [org.gradle.BuildExceptionReporter]
at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:63)
16:39:52.351 [ERROR] [org.gradle.BuildExceptionReporter]
at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:51)
16:39:52.351 [ERROR] [org.gradle.BuildExceptionReporter]
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:23)
16:39:52.351 [ERROR] [org.gradle.BuildExceptionReporter]
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:88)
16:39:52.351 [ERROR] [org.gradle.BuildExceptionReporter]
at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:29)
16:39:52.352 [ERROR] [org.gradle.BuildExceptionReporter]
at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:62)
16:39:52.352 [ERROR] [org.gradle.BuildExceptionReporter]
at org.gradle.execution.DefaultBuildExecuter.access$200(DefaultBuildExecuter.java:23)
16:39:52.352 [ERROR] [org.gradle.BuildExceptionReporter]
at org.gradle.execution.DefaultBuildExecuter$2.proceed(DefaultBuildExecuter.java:68)
16:39:52.353 [ERROR] [org.gradle.BuildExceptionReporter]
at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32)
16:39:52.353 [ERROR] [org.gradle.BuildExceptionReporter]
at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:62)
16:39:52.353 [ERROR] [org.gradle.BuildExceptionReporter]
at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:55)
16:39:52.353 [ERROR] [org.gradle.BuildExceptionReporter]
at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:149)
16:39:52.354 [ERROR] [org.gradle.BuildExceptionReporter]
at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:106)
16:39:52.354 [ERROR] [org.gradle.BuildExceptionReporter]
at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:86)
16:39:52.354 [ERROR] [org.gradle.BuildExceptionReporter]
at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:80)
16:39:52.355 [ERROR] [org.gradle.BuildExceptionReporter]
at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:33)
16:39:52.355 [ERROR] [org.gradle.BuildExceptionReporter]
at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:24)
16:39:52.355 [ERROR] [org.gradle.BuildExceptionReporter]
at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:36)
16:39:52.355 [ERROR] [org.gradle.BuildExceptionReporter]
at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:26)
16:39:52.356 [ERROR] [org.gradle.BuildExceptionReporter]
at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:51)
16:39:52.356 [ERROR] [org.gradle.BuildExceptionReporter]
at org.gradle.internal.Actions$RunnableActionAdapter.execute(Actions.java:171)
16:39:52.356 [ERROR] [org.gradle.BuildExceptionReporter]
at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:237)
16:39:52.357 [ERROR] [org.gradle.BuildExceptionReporter]
at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:210)
16:39:52.357 [ERROR] [org.gradle.BuildExceptionReporter]
at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:35)
16:39:52.357 [ERROR] [org.gradle.BuildExceptionReporter]
at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:24)
16:39:52.358 [ERROR] [org.gradle.BuildExceptionReporter]
at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:206)
16:39:52.358 [ERROR] [org.gradle.BuildExceptionReporter]
at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:169)
16:39:52.358 [ERROR] [org.gradle.BuildExceptionReporter]
at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33)
16:39:52.358 [ERROR] [org.gradle.BuildExceptionReporter]
at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:22)
16:39:52.359 [ERROR] [org.gradle.BuildExceptionReporter]
at org.gradle.launcher.Main.doAction(Main.java:33)
16:39:52.359 [ERROR] [org.gradle.BuildExceptionReporter]
at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)
16:39:52.359 [ERROR] [org.gradle.BuildExceptionReporter]
at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:54)
16:39:52.359 [ERROR] [org.gradle.BuildExceptionReporter]
at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:35)
16:39:52.360 [ERROR] [org.gradle.BuildExceptionReporter]
at org.gradle.launcher.GradleMain.main(GradleMain.java:23)
16:39:52.360 [ERROR] [org.gradle.BuildExceptionReporter] Caused by: java.lang.RuntimeException: java.lang.NullPointerException: Plugin annotation is null.
16:39:52.360 [ERROR] [org.gradle.BuildExceptionReporter]
at com.sun.tools.javac.main.Main.compile(Main.java:469)
16:39:52.360 [ERROR] [org.gradle.BuildExceptionReporter]
at com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:132)
16:39:52.361 [ERROR] [org.gradle.BuildExceptionReporter]
at org.gradle.api.internal.tasks.compile.JdkJavaCompiler.execute(JdkJavaCompiler.java:42)
16:39:52.361 [ERROR] [org.gradle.BuildExceptionReporter]
at org.gradle.api.internal.tasks.compile.JdkJavaCompiler.execute(JdkJavaCompiler.java:35)
16:39:52.361 [ERROR] [org.gradle.BuildExceptionReporter]
at org.gradle.api.internal.tasks.compile.NormalizingJavaCompiler.delegateAndHandleErrors(NormalizingJavaCompiler.java:97)
16:39:52.361 [ERROR] [org.gradle.BuildExceptionReporter]
at org.gradle.api.internal.tasks.compile.NormalizingJavaCompiler.execute(NormalizingJavaCompiler.java:50)
16:39:52.362 [ERROR] [org.gradle.BuildExceptionReporter]
at org.gradle.api.internal.tasks.compile.NormalizingJavaCompiler.execute(NormalizingJavaCompiler.java:36)
16:39:52.362 [ERROR] [org.gradle.BuildExceptionReporter]
at org.gradle.api.internal.tasks.compile.CleaningJavaCompilerSupport.execute(CleaningJavaCompilerSupport.java:34)
16:39:52.362 [ERROR] [org.gradle.BuildExceptionReporter]
at org.gradle.api.internal.tasks.compile.CleaningJavaCompilerSupport.execute(CleaningJavaCompilerSupport.java:25)
16:39:52.362 [ERROR] [org.gradle.BuildExceptionReporter]
at org.gradle.api.tasks.compile.JavaCompile.performCompilation(JavaCompile.java:158)
16:39:52.362 [ERROR] [org.gradle.BuildExceptionReporter]
at org.gradle.api.tasks.compile.JavaCompile.compile(JavaCompile.java:138)
16:39:52.363 [ERROR] [org.gradle.BuildExceptionReporter]
at org.gradle.api.tasks.compile.JavaCompile.compile(JavaCompile.java:92)
16:39:52.363 [ERROR] [org.gradle.BuildExceptionReporter]
at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:63)
16:39:52.363 [ERROR] [org.gradle.BuildExceptionReporter]
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$IncrementalTaskAction.doExecute(AnnotationProcessingTaskFactory.java:235)
16:39:52.363 [ERROR] [org.gradle.BuildExceptionReporter]
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:211)
16:39:52.364 [ERROR] [org.gradle.BuildExceptionReporter]
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$IncrementalTaskAction.execute(AnnotationProcessingTaskFactory.java:222)
16:39:52.364 [ERROR] [org.gradle.BuildExceptionReporter]
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:200)
16:39:52.364 [ERROR] [org.gradle.BuildExceptionReporter]
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80)
16:39:52.364 [ERROR] [org.gradle.BuildExceptionReporter]
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61)
16:39:52.365 [ERROR] [org.gradle.BuildExceptionReporter]
... 44 more
16:39:52.365 [ERROR] [org.gradle.BuildExceptionReporter] Caused by: java.lang.NullPointerException: Plugin annotation is null.
16:39:52.365 [ERROR] [org.gradle.BuildExceptionReporter]
at org.apache.logging.log4j.core.config.plugins.processor.PluginProcessor$PluginElementVisitor.visitType(PluginProcessor.java:129)
16:39:52.365 [ERROR] [org.gradle.BuildExceptionReporter]
at org.apache.logging.log4j.core.config.plugins.processor.PluginProcessor$PluginElementVisitor.visitType(PluginProcessor.java:118)
16:39:52.366 [ERROR] [org.gradle.BuildExceptionReporter]
at com.sun.tools.javac.code.Symbol$ClassSymbol.accept(Symbol.java:892)
16:39:52.366 [ERROR] [org.gradle.BuildExceptionReporter]
at org.apache.logging.log4j.core.config.plugins.processor.PluginProcessor.collectPlugins(PluginProcessor.java:94)
16:39:52.366 [ERROR] [org.gradle.BuildExceptionReporter]
at org.apache.logging.log4j.core.config.plugins.processor.PluginProcessor.process(PluginProcessor.java:73)
16:39:52.366 [ERROR] [org.gradle.BuildExceptionReporter]
at com.sun.tools.javac.processing.JavacProcessingEnvironment.callProcessor(JavacProcessingEnvironment.java:793)
16:39:52.366 [ERROR] [org.gradle.BuildExceptionReporter]
at com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs(JavacProcessingEnvironment.java:722)
16:39:52.367 [ERROR] [org.gradle.BuildExceptionReporter]
at com.sun.tools.javac.processing.JavacProcessingEnvironment.access$1700(JavacProcessingEnvironment.java:97)
16:39:52.367 [ERROR] [org.gradle.BuildExceptionReporter]
at com.sun.tools.javac.processing.JavacProcessingEnvironment$Round.run(JavacProcessingEnvironment.java:1029)
16:39:52.367 [ERROR] [org.gradle.BuildExceptionReporter]
at com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing(JavacProcessingEnvironment.java:1163)
16:39:52.368 [ERROR] [org.gradle.BuildExceptionReporter]
at com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:1108)
16:39:52.368 [ERROR] [org.gradle.BuildExceptionReporter]
at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:824)
16:39:52.368 [ERROR] [org.gradle.BuildExceptionReporter]
at com.sun.tools.javac.main.Main.compile(Main.java:439)
16:39:52.368 [ERROR] [org.gradle.BuildExceptionReporter]
... 62 more
16:39:52.368 [ERROR] [org.gradle.BuildExceptionReporter]
16:39:52.369 [LIFECYCLE] [org.gradle.BuildResultLogger]
16:39:52.369 [LIFECYCLE] [org.gradle.BuildResultLogger] BUILD FAILED
16:39:52.369 [LIFECYCLE] [org.gradle.BuildResultLogger]
16:39:52.370 [LIFECYCLE] [org.gradle.BuildResultLogger] Total time: 6.957 secs
Any help is much appreciated, very misleading NullPointer… What can happen in the code to get this?