Skip to content
This repository has been archived by the owner on Jun 10, 2021. It is now read-only.

Cannot upload when adding modifyPom closure #10

Closed
marceloverdijk opened this issue Oct 17, 2013 · 8 comments
Closed

Cannot upload when adding modifyPom closure #10

marceloverdijk opened this issue Oct 17, 2013 · 8 comments
Assignees

Comments

@marceloverdijk
Copy link

Without modifyPom I can upload successfully to Sonatype OSS but the artifacts cannot be closed as pom is not according the rules.
Hence I added modifyPom closure as described

modifyPom {
    project {
        ..
    }
}

But when I upload I get:

Execution failed for task ':uploadArchives'.

Could not publish configuration 'archives'
Failed to notify action.
> org.gradle.api.internal.MissingMethodException: Could not find method call() for arguments [build_25vt45toa4h0t5eac9511vbvf2$_run_closure1_closure9_closure12@3c71ebd6] on root project 'spring-appengine'.

When I just add:

modifyPom {
}

it works, but as soon as I adde the project section (even empty) it goes wrong.

@bmuschko
Copy link
Owner

No idea. I use this plugin in many other projects. Maybe there's a configuration problem in the project closure.

  1. How does your configuration look like?
  2. What's the stack trace of the failing build?

@marceloverdijk
Copy link
Author

See the complete stacktrace below.
Maybe it has something to do with:
Caused by: org.gradle.api.UncheckedIOException: Could not write to file '/Users/marceloverdijk/workspace/spring-appengine/build/poms/pom-default.xml'.

Full stacktrace:

192:spring-appengine marceloverdijk$ gradle clean uploadArchives --stacktrace
:buildSrc:compileJava UP-TO-DATE
:buildSrc:compileGroovy UP-TO-DATE
:buildSrc:processResources UP-TO-DATE
:buildSrc:classes UP-TO-DATE
:buildSrc:jar UP-TO-DATE
:buildSrc:assemble UP-TO-DATE
:buildSrc:compileTestJava UP-TO-DATE
:buildSrc:compileTestGroovy UP-TO-DATE
:buildSrc:processTestResources UP-TO-DATE
:buildSrc:testClasses UP-TO-DATE
:buildSrc:test UP-TO-DATE
:buildSrc:check UP-TO-DATE
:buildSrc:build UP-TO-DATE
The ConfigurationContainer.add() method has been deprecated and is scheduled to be removed in Gradle 2.0. Please use the create() method instead.
:clean UP-TO-DATE
:compileJava
warning: [options] bootstrap class path not set in conjunction with -source 1.6
1 warning
:processResources UP-TO-DATE
:classes
:jar
:javadoc
:javadocJar
:sourcesJar
:signArchives
:uploadArchives FAILED

FAILURE: Build failed with an exception.

* Where:
Build file '/Users/marceloverdijk/workspace/spring-appengine/build.gradle' line: 69

* What went wrong:
Execution failed for task ':uploadArchives'.
> Could not publish configuration 'archives'
   > Failed to notify action.
      > org.gradle.api.internal.MissingMethodException: Could not find method call() for arguments [build_25vt45toa4h0t5eac9511vbvf2$_run_closure1_closure9_closure12@50cad4be] on root project 'spring-appengine'.

* Try:
Run with --info or --debug option to get more log output.

* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':uploadArchives'.
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:69)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46)
    at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:35)
    at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:62)
    at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
    at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:42)
    at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
    at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:53)
    at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
    at org.gradle.api.internal.AbstractTask.executeWithoutThrowingTaskFailure(AbstractTask.java:286)
    at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.executeTask(AbstractTaskPlanExecutor.java:80)
    at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:66)
    at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.executeTaskWithCacheLock(AbstractTaskPlanExecutor.java:58)
    at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:47)
    at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$1.run(DefaultTaskPlanExecutor.java:33)
    at org.gradle.internal.Factories$1.create(Factories.java:22)
    at org.gradle.cache.internal.DefaultCacheAccess.longRunningOperation(DefaultCacheAccess.java:214)
    at org.gradle.cache.internal.DefaultCacheAccess.longRunningOperation(DefaultCacheAccess.java:276)
    at org.gradle.cache.internal.DefaultPersistentDirectoryStore.longRunningOperation(DefaultPersistentDirectoryStore.java:142)
    at org.gradle.api.internal.changedetection.state.DefaultTaskArtifactStateCacheAccess.longRunningOperation(DefaultTaskArtifactStateCacheAccess.java:78)
    at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:31)
    at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:89)
    at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:29)
    at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:61)
    at org.gradle.execution.DefaultBuildExecuter.access$200(DefaultBuildExecuter.java:23)
    at org.gradle.execution.DefaultBuildExecuter$2.proceed(DefaultBuildExecuter.java:67)
    at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32)
    at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:61)
    at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:54)
    at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:166)
    at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:113)
    at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:81)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:64)
    at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:33)
    at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:24)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:35)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:26)
    at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:50)
    at org.gradle.api.internal.Actions$RunnableActionAdapter.execute(Actions.java:171)
    at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:201)
    at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:174)
    at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:170)
    at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:139)
    at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33)
    at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:22)
    at org.gradle.launcher.Main.doAction(Main.java:48)
    at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)
    at org.gradle.launcher.Main.main(Main.java:39)
    at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:50)
    at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:32)
    at org.gradle.launcher.GradleMain.main(GradleMain.java:26)
Caused by: org.gradle.api.artifacts.PublishException: Could not publish configuration 'archives'
    at org.gradle.api.tasks.Upload.upload(Upload.java:73)
    at org.gradle.api.internal.BeanDynamicObject$MetaClassAdapter.invokeMethod(BeanDynamicObject.java:248)
    at org.gradle.api.internal.BeanDynamicObject.invokeMethod(BeanDynamicObject.java:136)
    at org.gradle.api.internal.CompositeDynamicObject.invokeMethod(CompositeDynamicObject.java:147)
    at org.gradle.api.tasks.Upload_Decorated.invokeMethod(Unknown Source)
    at org.gradle.api.internal.BeanDynamicObject$MetaClassAdapter.invokeMethod(BeanDynamicObject.java:248)
    at org.gradle.api.internal.BeanDynamicObject.invokeMethod(BeanDynamicObject.java:136)
    at org.gradle.api.internal.CompositeDynamicObject.invokeMethod(CompositeDynamicObject.java:147)
    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$StandardTaskAction.doExecute(AnnotationProcessingTaskFactory.java:220)
    at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:213)
    at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:202)
    at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:530)
    at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:513)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61)
    ... 50 more
Caused by: org.gradle.api.UncheckedIOException: Could not write to file '/Users/marceloverdijk/workspace/spring-appengine/build/poms/pom-default.xml'.
    at org.gradle.api.internal.IoActions$TextFileWriterIoAction.execute(IoActions.java:88)
    at org.gradle.api.internal.IoActions$TextFileWriterIoAction.execute(IoActions.java:64)
    at org.gradle.api.internal.IoActions.writeTextFile(IoActions.java:38)
    at org.gradle.api.publication.maven.internal.DefaultMavenPom.writeTo(DefaultMavenPom.java:200)
    at org.gradle.api.publication.maven.internal.DefaultMavenPom.writeTo(DefaultMavenPom.java:45)
    at org.gradle.api.publication.maven.internal.DefaultArtifactPom.writePom(DefaultArtifactPom.java:60)
    at org.gradle.api.publication.maven.internal.DefaultArtifactPomContainer.createDeployableFilesInfos(DefaultArtifactPomContainer.java:65)
    at org.gradle.api.publication.maven.internal.ant.AbstractMavenResolver.commitPublishTransaction(AbstractMavenResolver.java:181)
    at org.gradle.api.internal.artifacts.ivyservice.IvyResolverBackedModuleVersionPublisher.publish(IvyResolverBackedModuleVersionPublisher.java:58)
    at org.gradle.api.internal.artifacts.ivyservice.DefaultIvyDependencyPublisher.publish(DefaultIvyDependencyPublisher.java:49)
    at org.gradle.api.internal.artifacts.ivyservice.IvyBackedArtifactPublisher.publish(IvyBackedArtifactPublisher.java:76)
    at org.gradle.api.tasks.Upload.upload(Upload.java:71)
    ... 66 more
Caused by: org.gradle.listener.ListenerNotificationException: Failed to notify action.
    at org.gradle.listener.BroadcastDispatch.dispatch(BroadcastDispatch.java:90)
    at org.gradle.listener.BroadcastDispatch.dispatch(BroadcastDispatch.java:30)
    at org.gradle.messaging.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93)
    at $Proxy11.execute(Unknown Source)
    at org.gradle.listener.ActionBroadcast.execute(ActionBroadcast.java:30)
    at org.gradle.api.publication.maven.internal.DefaultMavenPom.getEffectivePom(DefaultMavenPom.java:173)
    at org.gradle.api.publication.maven.internal.DefaultMavenPom.writeTo(DefaultMavenPom.java:192)
    at org.gradle.api.publication.maven.internal.DefaultMavenPom$1.execute(DefaultMavenPom.java:202)
    at org.gradle.api.publication.maven.internal.DefaultMavenPom$1.execute(DefaultMavenPom.java:200)
    at org.gradle.api.internal.IoActions$TextFileWriterIoAction.execute(IoActions.java:83)
    ... 77 more
Caused by: org.codehaus.groovy.runtime.InvokerInvocationException: org.gradle.api.internal.MissingMethodException: Could not find method call() for arguments [build_25vt45toa4h0t5eac9511vbvf2$_run_closure1_closure9_closure12@50cad4be] on root project 'spring-appengine'.
    at org.gradle.api.internal.ClosureBackedAction.execute(ClosureBackedAction.java:58)
    at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
    at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
    at org.gradle.listener.BroadcastDispatch.dispatch(BroadcastDispatch.java:81)
    ... 86 more
Caused by: org.gradle.api.internal.MissingMethodException: Could not find method call() for arguments [build_25vt45toa4h0t5eac9511vbvf2$_run_closure1_closure9_closure12@50cad4be] on root project 'spring-appengine'.
    at org.gradle.api.internal.AbstractDynamicObject.methodMissingException(AbstractDynamicObject.java:68)
    at org.gradle.api.internal.AbstractDynamicObject.invokeMethod(AbstractDynamicObject.java:56)
    at org.gradle.api.internal.CompositeDynamicObject.invokeMethod(CompositeDynamicObject.java:172)
    at org.gradle.api.internal.project.DefaultProject_Decorated.invokeMethod(Unknown Source)
    at build_25vt45toa4h0t5eac9511vbvf2$_run_closure1_closure9.doCall(/Users/marceloverdijk/workspace/spring-appengine/build.gradle:69)
    at org.gradle.api.internal.ClosureBackedAction.execute(ClosureBackedAction.java:58)
    at org.gradle.util.ConfigureUtil.configure(ConfigureUtil.java:133)
    at org.gradle.util.ConfigureUtil.configure(ConfigureUtil.java:94)
    at org.gradle.api.internal.project.AbstractProject.configure(AbstractProject.java:857)
    at org.gradle.api.internal.BeanDynamicObject$MetaClassAdapter.invokeMethod(BeanDynamicObject.java:248)
    at org.gradle.api.internal.BeanDynamicObject.invokeMethod(BeanDynamicObject.java:136)
    at org.gradle.api.internal.CompositeDynamicObject.invokeMethod(CompositeDynamicObject.java:147)
    at org.gradle.api.internal.project.DefaultProject_Decorated.invokeMethod(Unknown Source)
    at org.gradle.api.plugins.nexus.NexusPlugin$_configurePom_closure2_closure9_closure10.doCall(NexusPlugin.groovy:107)
    ... 90 more


BUILD FAILED

Total time: 12.079 secs
192:spring-appengine marceloverdijk$ 

@marceloverdijk
Copy link
Author

Btw, do you use the plugin in open source project, so I can have a look on that build file as well to see if there are differences.

@bmuschko
Copy link
Owner

Yes, for example in the GAE plugin. Not sure what is going wrong. Can you point me to your project?

@marceloverdijk
Copy link
Author

Thanks for helping. This is my project: https://github.com/marceloverdijk/spring-appengine

@marceloverdijk
Copy link
Author

It has to do with the configure(allprojects) { project -> block.
When I remove this block everything seems to work fine, but I don't understand what is going wrong because everything else is going fine.

@bmuschko
Copy link
Owner

It might have something to do with closure delegation as you put the code into configure(allprojects). As mentioned in the other issue I'd move it out of that block. You don't want to publish the sample projects anyway.

@marceloverdijk
Copy link
Author

Yes I moved the nexus plugin and modifyPom part outside of the configure(allprojects) and then everything works like expected. Thanks for helping!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants