jfrog / build-info

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

artifactoryPublish fails if configuration on demand is enabled #172

Open Steppschuh opened 6 years ago

Steppschuh commented 6 years ago

Expected behaviour

Executing ./gradlew artifactoryPublish publishes artefacts. Output:

13:20:53: Executing task 'artifactoryPublish'...

Executing tasks: [artifactoryPublish]

:library:generatePomFileForAarPublication
:library:artifactoryPublish
:artifactoryDeploy
Deploying artifact: http://localhost:8081/artifactory/gradle-dev-local/gradle-android-example/library/1.0-SNAPSHOT/library-1.0-SNAPSHOT.aar
Deploying artifact: http://localhost:8081/artifactory/gradle-dev-local/gradle-android-example/library/1.0-SNAPSHOT/library-1.0-SNAPSHOT.pom
Deploying build descriptor to: http://localhost:8081/artifactory/api/build
Build successfully deployed. Browse it in Artifactory under http://localhost:8081/artifactory/webapp/builds/gradle-android-example/1530098455348

BUILD SUCCESSFUL in 2s
3 actionable tasks: 3 executed
13:20:56: Task execution finished 'artifactoryPublish'.

Actual behaviour

Executing ./gradlew artifactoryPublish doesn't publish any artefacts. Output:

13:22:48: Executing task 'artifactoryPublish'...

Executing tasks: [artifactoryPublish]

Configuration on demand is an incubating feature.
:library:artifactoryPublish

BUILD SUCCESSFUL in 1s
1 actionable task: 1 executed
13:22:50: Task execution finished 'artifactoryPublish'.

Steps to reproduce

Configuration on demand is an often (1, 2, 3) recommended build performance optimization for larger projects with multiple modules.

Finding the cause of this issue burned quite a few hours. There should be at least a warning or error message if the artifactory plugin can't work properly with that flag enabled.

sky-ricardocarrapico commented 3 years ago

Just lost some hours because of this issue. I added configuration on demand together with some other Gradle changes and it was not clear at all that this was the cause as the problem is completely silent.

Maragues commented 2 years ago

Wow, this is still not supported after 4 years?

When configureOnDemand=true, If I run these commands one after the other, the group of the -domain dependency is not resolved and it's wrong

./gradlew :ble:generatePomFileForAarPublication
./gradlew :ble-domain:generatePomFileForAarPublication

Snippet from generated pom for ble module

    <dependency>
      <groupId>ProjectName.ble</groupId>
      <artifactId>ble-domain</artifactId>
      <version>0.3.0</version>
    </dependency>

The group is resolved as expected if you run one after the oner

./gradlew :ble-domain:generatePomFileForAarPublication :ble:generatePomFileForAarPublication 

And now, the group is correct

    <dependency>
      <groupId>my.company</groupId>
      <artifactId>ble-domain</artifactId>
      <version>0.3.0</version>
    </dependency>

Come on JFrog, give some ❤️ to this plugin!