[GRADLE-1217] Lack of maven plugin throws ugly NPE when trying to use mavenDeployer Created: 14/Nov/10  Updated: 04/Jan/13  Resolved: 09/Sep/11

Status: Resolved
Project: Gradle
Affects Version/s: 0.9
Fix Version/s: 1.0-milestone-5

Type: Improvement
Reporter: Baruch Sadogursky Assignee: Adam Murdoch
Resolution: Fixed Votes: 0


 Description   

Using of the following code without appying maven plugin throws NPE

 
uploadArchives {
    repositories.mavenDeployer {...}
}

Stack trace:

Execution failed for task ':uploadArchives'.
at org.gradle.api.internal.tasks.DefaultTaskExecuter.executeActions(DefaultTaskExecuter.java:66)
at org.gradle.api.internal.tasks.DefaultTaskExecuter.execute(DefaultTaskExecuter.java:43)
at org.gradle.api.internal.project.taskfactory.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:32)
at org.gradle.api.internal.project.taskfactory.ExecutionShortCircuitTaskExecuter.execute(ExecutionShortCircuitTaskExecuter.java:50)
at org.gradle.api.internal.tasks.SkipTaskExecuter.doExecute(SkipTaskExecuter.java:57)
at org.gradle.api.internal.tasks.SkipTaskExecuter.execute(SkipTaskExecuter.java:35)
at org.gradle.api.internal.tasks.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:32)
at org.gradle.api.internal.AbstractTask.execute(AbstractTask.java:231)
at org.gradle.execution.DefaultTaskGraphExecuter.executeTask(DefaultTaskGraphExecuter.java:167)
at org.gradle.execution.DefaultTaskGraphExecuter.doExecute(DefaultTaskGraphExecuter.java:160)
at org.gradle.execution.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:78)
at org.gradle.execution.TaskNameResolvingBuildExecuter.execute(TaskNameResolvingBuildExecuter.java:113)
at org.gradle.execution.DelegatingBuildExecuter.execute(DelegatingBuildExecuter.java:54)
at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:153)
at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:107)
at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:75)
at org.gradle.launcher.CommandLineActionFactory$RunBuildAction.run(CommandLineActionFactory.java:171)
at org.gradle.launcher.CommandLineActionFactory$WithLoggingAction.run(CommandLineActionFactory.java:192)
at org.gradle.launcher.Main.execute(Main.java:51)
at org.gradle.launcher.Main.main(Main.java:38)
at org.gradle.launcher.GradleMain.main(GradleMain.java:52)
Caused by: org.gradle.api.GradleException: Could not publish configurations [configuration ':archives'].
at org.gradle.api.internal.artifacts.ivyservice.ErrorHandlingIvyService.publish(ErrorHandlingIvyService.java:44)
at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.publish(DefaultConfiguration.java:211)
at org.gradle.api.tasks.Upload.upload(Upload.java:56)
at org.gradle.api.internal.BeanDynamicObject.invokeMethod(BeanDynamicObject.java:158)
at org.gradle.api.internal.CompositeDynamicObject.invokeMethod(CompositeDynamicObject.java:93)
at org.gradle.api.tasks.Upload_Decorated.invokeMethod(Unknown Source)
at org.gradle.util.ReflectionUtil.invoke(ReflectionUtil.groovy:23)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$2.execute(AnnotationProcessingTaskFactory.java:131)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$2.execute(AnnotationProcessingTaskFactory.java:129)
at org.gradle.api.internal.tasks.DefaultTaskExecuter.executeActions(DefaultTaskExecuter.java:58)
... 20 more
Caused by: java.lang.NullPointerException
at org.gradle.api.internal.artifacts.publish.maven.DefaultMavenPomFactory.create(DefaultMavenPomFactory.java:45)
at org.gradle.api.internal.artifacts.publish.maven.DefaultMavenPomFactory.create(DefaultMavenPomFactory.java:29)
at org.gradle.api.internal.artifacts.publish.maven.deploy.BasePomFilterContainer.getDefaultPomFilter(BasePomFilterContainer.java:120)
at org.gradle.api.internal.artifacts.publish.maven.deploy.BasePomFilterContainer.getActivePomFilters(BasePomFilterContainer.java:106)
at org.gradle.api.internal.artifacts.publish.maven.deploy.DefaultArtifactPomContainer.addArtifact(DefaultArtifactPomContainer.java:49)
at org.gradle.api.internal.artifacts.publish.maven.deploy.AbstractMavenResolver.publish(AbstractMavenResolver.java:155)
at org.apache.ivy.core.publish.PublishEngine.publish(PublishEngine.java:281)
at org.apache.ivy.core.publish.PublishEngine.publish(PublishEngine.java:260)
at org.gradle.api.internal.artifacts.ivyservice.DefaultIvyDependencyPublisher.publish(DefaultIvyDependencyPublisher.java:54)
at org.gradle.api.internal.artifacts.ivyservice.DefaultIvyService.publish(DefaultIvyService.java:144)
at org.gradle.api.internal.artifacts.ivyservice.ShortcircuitEmptyConfigsIvyService.publish(ShortcircuitEmptyConfigsIvyService.java:61)
at org.gradle.api.internal.artifacts.ivyservice.ErrorHandlingIvyService.publish(ErrorHandlingIvyService.java:42)
... 29 more



 Comments   
Comment by Josh Diehl [ 02/Jul/11 ]

Still seeing this in gradle-1.0-milestone-1 , cost me about an hour of digging to find this cause.

Generated at Wed Jun 30 11:49:57 CDT 2021 using Jira 8.4.2#804003-sha1:d21414fc212e3af190e92c2d2ac41299b89402cf.