Gradle v2.2; Gradle install and Gradle uploadArchive don't work when parallel build option is activated

when the option ‘org.gradle.parallel=true’ is activated, launch command ‘gradle install’ and ‘gradle uploadArchive’ don’t work.

Exception message is :

:komea-product:komea-rest-api:install FAILED [INFO] Installing /home/jguidoux/work/Tocea/komea-product/komea-product/komea-rest-api/build/libs/komea-rest-api-SPRINT.jar to /home/jguidoux/LocalRepository/org/komea/product/backend/komea-rest-api/SPRINT/komea-rest-api-SPRINT.jar [INFO] Installing /home/jguidoux/work/Tocea/komea-product/komea-product/komea-randomizer-plugin/build/libs/komea-randomizer-plugin-SPRINT.jar to /home/jguidoux/LocalRepository/org/komea/product/backend/komea-randomizer-plugin/SPRINT/komea-randomizer-plugin-SPRINT.jar

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ‘:komea-product:komea-kpis-service:install’. > Could not publish configuration ‘archives’

Unable to initialize POM pom-default.xml: Failed to interpolate field: private java.lang.Object org.apache.maven.model.ModelBase.reports on class: org.apache.maven.model.ModelBase for project org.komea.product.backend:komea-kpis-service at /home/jguidoux/work/Tocea/komea-product/komea-product/komea-kpis-service/build/poms/pom-default.xml

  • Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

When the parallel is : ‘org.gradle.parallel=false’, it works

The old publishing mechanism is unfortunately not thread safe and cannot be run in parallel. If you want to leverage parallel build support I suggest you look at using the new Maven publishing mechanism.

I just try the new maven-publish plugin, but I have a have a multi project to build, These projects can be of different types like ‘java’, ‘war’, ‘application’… when l try to publish to my maven local repository for test, I have this problem ;

:plugins:komea-bugzilla-batch-history:publishMavenJavaPublicationToMavenLocal FAILED :plugins:komea-bugzilla-batch-history:publishMavenJavaPublicationToMavenLocal (Thread[Daemon worker Thread 4,5,main]) completed. Took 0.006 secs.

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ‘:plugins:komea-bugzilla-batch-history:publishMavenJavaPublicationToMavenLocal’. > Failed to publish publication ‘mavenJava’ to repository ‘MavenLocal’

Invalid publication ‘mavenJava’: Cannot determine main artifact - multiple artifacts found with empty classifier.

‘plugins:komea-bugzilla-batch-history’ project is of type ‘application’ project

any idea ?

thanks,

Jeremie

This is GRADLE-2492. We have a workaround for this in the Gradle build itself that you could “borrow” :slight_smile:

https://github.com/gradle/gradle/blob/master/gradle/fix-GRADLE-2492.gradle

Thanks for this solution,

With this, I can still use the ‘maven’ plugin. But if I understand, the goal of the ‘maven-publish’ plugin is to replace the ‘maven’ plugin. Is that right ? In these case, is there a solution with the ‘maven-publish’ plugin ?