Error in parallel build


(m m) #1

I get the below error when I try to do a parallel build . If I remove the “org.gradle.parallel=true” , then it works . Looks like error in maven upload . Is there any workaround/fix for this ?

FAILURE: Build failed with an exception.
  * What went wrong:
Execution failed for task ':hessiansvc:uploadArchives'.
> Could not publish configuration 'archives'
   > Unable to interpolate POM pom-default.xml: Failed to interpolate field: pri
vate java.lang.String org.apache.maven.model.Build.sourceDirectory on class: org
.apache.maven.model.Build
  * Try:
Run with --debug option to get more log output.
  * Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':test-se
rviceconsumer-hessian:uploadArchives'.
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.ex
ecuteActions(ExecuteActionsTaskExecuter.java:69)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.ex
ecute(ExecuteActionsTaskExecuter.java:46)
        at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExec
uter.execute(PostExecutionAnalysisTaskExecuter.java:35)
        at org.gradle.api.internal.changedetection.state.CacheLockReleasingTaskE
xecuter$1.run(CacheLockReleasingTaskExecuter.java:35)
        at org.gradle.internal.Factories$1.create(Factories.java:22)
        at org.gradle.cache.internal.DefaultCacheAccess.longRunningOperation(Def
aultCacheAccess.java:179)
        at org.gradle.cache.internal.DefaultCacheAccess.longRunningOperation(Def
aultCacheAccess.java:232)
        at org.gradle.cache.internal.DefaultPersistentDirectoryStore.longRunning
Operation(DefaultPersistentDirectoryStore.java:142)
        at org.gradle.api.internal.changedetection.state.DefaultTaskArtifactStat
eCacheAccess.longRunningOperation(DefaultTaskArtifactStateCacheAccess.java:83)
        at org.gradle.api.internal.changedetection.state.CacheLockReleasingTaskE
xecuter.execute(CacheLockReleasingTaskExecuter.java:33)
        at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.exec
ute(SkipUpToDateTaskExecuter.java:58)
        at org.gradle.api.internal.tasks.execution.ContextualisingTaskExecuter.e
xecute(ContextualisingTaskExecuter.java:34)
        at org.gradle.api.internal.changedetection.state.CacheLockAcquiringTaskE
xecuter$1.run(CacheLockAcquiringTaskExecuter.java:39)
        at org.gradle.internal.Factories$1.create(Factories.java:22)
        at org.gradle.cache.internal.DefaultCacheAccess.useCache(DefaultCacheAcc
ess.java:124)
        at org.gradle.cache.internal.DefaultCacheAccess.useCache(DefaultCacheAcc
ess.java:112)
        at org.gradle.cache.internal.DefaultPersistentDirectoryStore.useCache(De
faultPersistentDirectoryStore.java:134)
        at org.gradle.api.internal.changedetection.state.DefaultTaskArtifactStat
eCacheAccess.useCache(DefaultTaskArtifactStateCacheAccess.java:79)
        at org.gradle.api.internal.changedetection.state.CacheLockAcquiringTaskE
xecuter.execute(CacheLockAcquiringTaskExecuter.java:37)
        at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execut
e(ValidatingTaskExecuter.java:57)
        at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecu
ter.execute(SkipEmptySourceFilesTaskExecuter.java:41)
        at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter
.execute(SkipTaskWithNoActionsExecuter.java:51)
        at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execut
e(SkipOnlyIfTaskExecuter.java:52)
        at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter
.execute(ExecuteAtMostOnceTaskExecuter.java:42)
        at org.gradle.api.internal.AbstractTask.executeWithoutThrowingTaskFailur
e(AbstractTask.java:282)
        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.executeTask(De
faultTaskPlanExecutor.java:48)
        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.processTask(De
faultTaskPlanExecutor.java:34)
        at org.gradle.execution.taskgraph.ParallelTaskPlanExecutor$TaskExecutorW
orker$1.run(ParallelTaskPlanExecutor.java:117)
        at org.gradle.internal.Factories$1.create(Factories.java:22)
        at org.gradle.cache.internal.DefaultCacheAccess.useCache(DefaultCacheAcc
ess.java:124)
        at org.gradle.cache.internal.DefaultCacheAccess.useCache(DefaultCacheAcc
ess.java:112)
        at org.gradle.cache.internal.DefaultPersistentDirectoryStore.useCache(De
faultPersistentDirectoryStore.java:134)
        at org.gradle.api.internal.changedetection.state.DefaultTaskArtifactStat
eCacheAccess.useCache(DefaultTaskArtifactStateCacheAccess.java:79)
        at org.gradle.execution.taskgraph.ParallelTaskPlanExecutor$TaskExecutorW
orker.executeTaskWithCacheLock(ParallelTaskPlanExecutor.java:114)
        at org.gradle.execution.taskgraph.ParallelTaskPlanExecutor$TaskExecutorW
orker.run(ParallelTaskPlanExecutor.java:104)
        at org.gradle.internal.concurrent.DefaultExecutorFactory$StoppableExecut
orImpl$1.run(DefaultExecutorFactory.java:66)
Caused by: org.gradle.api.artifacts.PublishException: Could not publish configur
ation 'archives'
        at org.gradle.api.tasks.Upload.upload(Upload.java:84)
        at org.gradle.api.internal.BeanDynamicObject$MetaClassAdapter.invokeMeth
od(BeanDynamicObject.java:216)
        at org.gradle.api.internal.BeanDynamicObject.invokeMethod(BeanDynamicObj
ect.java:122)
        at org.gradle.api.internal.CompositeDynamicObject.invokeMethod(Composite
DynamicObject.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.AnnotationProcessingTaskF
actory$StandardTaskAction.doExecute(AnnotationProcessingTaskFactory.java:217)
        at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskF
actory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:210)
        at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskF
actory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:199)
        at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(Abstra
ctTask.java:526)
        at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(Abstra
ctTask.java:509)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.ex
ecuteAction(ExecuteActionsTaskExecuter.java:80)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.ex
ecuteActions(ExecuteActionsTaskExecuter.java:61)
        ... 35 more
Caused by: Unable to interpolate POM pom-default.xml: Failed to interpolate fiel
d: private java.lang.String org.apache.maven.model.Build.sourceDirectory on clas
s: org.apache.maven.model.Build
        at org.apache.maven.artifact.ant.Pom.initialiseMavenProject(Pom.java:221
)
        at org.apache.maven.artifact.ant.AbstractArtifactTask.initializePom(Abst
ractArtifactTask.java:527)
        at org.apache.maven.artifact.ant.InstallDeployTaskSupport.initializePom(
InstallDeployTaskSupport.java:59)
        at org.apache.maven.artifact.ant.DeployTask.doExecute(DeployTask.java:98
)
        at org.gradle.api.publication.maven.internal.ant.CustomDeployTask.doExec
ute(CustomDeployTask.java:41)
        at org.apache.maven.artifact.ant.AbstractArtifactTask.execute(AbstractAr
tifactTask.java:751)
        at org.gradle.api.publication.maven.internal.ant.AbstractMavenResolver.e
xecute(AbstractMavenResolver.java:196)
        at org.gradle.api.publication.maven.internal.ant.AbstractMavenResolver.c
ommitPublishTransaction(AbstractMavenResolver.java:187)
        at org.gradle.api.internal.artifacts.ivyservice.IvyResolverBackedModuleV
ersionPublisher.publish(IvyResolverBackedModuleVersionPublisher.java:55)
        at org.gradle.api.internal.artifacts.ivyservice.DefaultIvyDependencyPubl
isher$Publication.publishTo(DefaultIvyDependencyPublisher.java:77)
        at org.gradle.api.internal.artifacts.ivyservice.DefaultIvyDependencyPubl
isher.publish(DefaultIvyDependencyPublisher.java:48)
        at org.gradle.api.internal.artifacts.ivyservice.IvyBackedArtifactPublish
er.publish(IvyBackedArtifactPublisher.java:63)
        at org.gradle.api.tasks.Upload.upload(Upload.java:82)
        ... 47 more
Caused by: org.apache.maven.project.interpolation.ModelInterpolationException: F
ailed to interpolate field: private java.lang.String org.apache.maven.model.Buil
d.sourceDirectory on class: org.apache.maven.model.Build
        at org.apache.maven.project.interpolation.StringSearchModelInterpolator$
InterpolateObjectAction.traverseObjectWithParents(StringSearchModelInterpolator.
java:318)
        at org.apache.maven.project.interpolation.StringSearchModelInterpolator$
InterpolateObjectAction.run(StringSearchModelInterpolator.java:135)
        at org.apache.maven.project.interpolation.StringSearchModelInterpolator$
InterpolateObjectAction.run(StringSearchModelInterpolator.java:102)
        at org.apache.maven.project.interpolation.StringSearchModelInterpolator.
interpolateObject(StringSearchModelInterpolator.java:80)
        at org.apache.maven.project.interpolation.StringSearchModelInterpolator.
interpolate(StringSearchModelInterpolator.java:62)
        at org.apache.maven.project.DefaultMavenProjectBuilder.calculateConcrete
StateInternal(DefaultMavenProjectBuilder.java:1856)
        at org.apache.maven.project.DefaultMavenProjectBuilder.calculateConcrete
State(DefaultMavenProjectBuilder.java:1814)
        at org.apache.maven.artifact.ant.Pom.initialiseMavenProject(Pom.java:213
)
        ... 59 more
Caused by: java.lang.IllegalAccessException: Class org.apache.maven.project.inte
rpolation.StringSearchModelInterpolator$InterpolateObjectAction can not access a
 member of class org.apache.maven.model.Build with modifiers "private"
        at org.apache.maven.project.interpolation.StringSearchModelInterpolator$
InterpolateObjectAction.traverseObjectWithParents(StringSearchModelInterpolator.
java:189)
        ... 66 more

(m m) #2

I observed that the above issue has been addressed in maven 3.0.4

http://jira.codehaus.org/browse/MNG-4542

Where can I find which version of maven jars is used by gradle for upload task ?


(Luke Daley) #3

If you use the new maven publish plugin, you won’t have this problem.

http://www.gradle.org/docs/current/userguide/publishing_maven.html


(m m) #4

I am getting the error still.

I added apply plugin: ‘maven-publish’ to the init.gradle.

How can I check whether the latest version of maven-publish has been used. I am using gradle 1.10


(Luke Daley) #5

The uploadArchives task is from the old publishing support which is not threadsafe. You need to use the publish* tasks from the new plugin.


(m m) #6

Thanks. Can you please provide the link to document on how to use the publish tasks from the new plugin ?


(Luke Daley) #7

http://www.gradle.org/docs/current/userguide/publishing_maven.html


(m m) #8

I tried the steps mentioned in the doc . Let me know if I am doing something wrong.

I have added the below task to init.gradle after removing the upload task

publishing {

publications {

mavenJava(MavenPublication) {

from components.java

}

}

repositories {

maven {

url “file:D:\gradle-work-repo”

}

}

}

I get the below error.

Execution failed for task ‘:publishMavenJavaPublicationToMavenRepository’. > Failed to publish publication ‘mavenJava’ to repository ‘maven’

Invalid publication ‘mavenJava’: groupId cannot be empty.


(m m) #9

Please ignore the above comment . It was a mistake in my configuration