jfrog / build-info

Artifactory's open integration layer for CI build servers
https://www.buildinfo.org
Apache License 2.0
148 stars 157 forks source link

Gradle Artifactory plugin does not support multi-module project as well #145

Open imanushin opened 6 years ago

imanushin commented 6 years ago

Gradle supports multimodule project (see in official doc).

This is useful when you try to decompose solid project to modules (for example, to have different modules - server, client, model).

However, gradle artifactory plugin is unable to publish build info for subprojects.

So, in my example:

  1. Root project does not have any dependency (it is just container)
  2. Subprojects are ordinal java projects
  3. Each subproject has artifactoryPublish task
  4. After calling .\gradlew.bat :artifactoryPublish

Expected result: All modules are published, build info is published to each module (or build info has unified data of all submodules)

Actual result: All modules are published. No build info was published to artifactory

skjolber commented 6 years ago

@imanushin I am able to publish build info for multi-module projects, however this requires me to set publishBuildInfo=false in subprojects and publishArtifacts = false in the main 'wrapper' project.

Edit: Example configuration: https://github.com/skjolber/gradle-foss-library-template/blob/master/build.gradle

oliemansm commented 6 years ago

@imanushin Running into the same problem here. @skjolber You're solution doesn't seem to work for me.

skjolber commented 6 years ago

@oliemansm does the sample not work, and/or what is the error you're tetting?

oliemansm commented 6 years ago

@skjolber Actually, after googling a bit more I found this issue: https://stackoverflow.com/questions/35851251/gradle-artifactory-plugin-how-to-publish-artifacts-from-multiple-modules-in-a. Following that config did solve the problem for me.

jackwhelpton commented 4 years ago

Has there been any progress on this? The config in that linked StackOverflow post doesn't work me. I'm receiving the error:

ERROR: Couldn't read generated build info at : /home/jenkins/agent/workspace/dir@tmp/artifactory/generated.build.info8485814835938481452.json

I'm investigating the behavior with different versions of the plugin, as the StackOverflow post references this not working since 4.6.0. I'm using Gradle 5.2.1, I think I need to use 4.7.3 of plugin or later, as otherwise I'm hitting https://github.com/jfrog/build-info/issues/166.

For me, 4.16.0 throws this error, whilst 4.15.2 is working (at least with publishBuildInfo = false). As this is a specific regression (probably related to "Empty modules without artifacts and dependencies will not be added to the build-info from now", I've raised a fresh ticket: https://github.com/jfrog/build-info/issues/384.