jfrog / artifactory-gradle-plugin

JFrog Gradle plugin for Build Info extraction and Artifactory publishing.
Apache License 2.0
20 stars 15 forks source link

After upgrading from 5.1.10 to 5.1.11 jar file is not published #104

Open remy-tiitre opened 5 months ago

remy-tiitre commented 5 months ago

Describe the bug

After mentioned upgrade publish command publishes pom file only. No jar files are published.

Current behavior

Only pom is published.

Reproduction steps

It is probably hard to reproduce this issue as we are using our own custom wrapper and we are using Nebulas pusblishing plugins etc. But I have narrowed it down that only changeing org.jfrog.buildinfo:build-info-extractor-gradle:5.1.10 to 5.1.11 causes this issue. Its also visible from debug script:

allprojects{
    afterEvaluate {
        println("Publications:")
        project.publishing.publications.each{publication->
            println(">>: ${publication.groupId}:${publication.artifactId}:${publication.version}")
            publication.artifacts.each{artifact->
                println("\t${artifact.classifier}:${artifact.extension}")
            }
        }
    }
}

5.1.10 produces:

Configure project : Publications:

: group.demo:demo:1.0.1-local javadoc:jar sources:jar null:jar

5.1.11 produces:

Configure project : Publications:

: group.demo:demo:1.0.1-local

Expected behavior

I expect it to keep uploading all artifacts. But as I can understand how hard it is to troubleshoot an issue that you can't reproduce, maybe you can provide additional tips and hints how to narrow it down.

Artifactory Gradle plugin version

5.1.11

Operating system type and version

Ubuntu 22.04

JFrog Artifactory version

Not important, reproducable in Maven Local

Gradle version

8.4

juanmanuelromeraferrio commented 4 months ago

I've encountered the same issue.

Steps to Reproduce & Debug

  1. Add the following script to the build.gradle file in the root project to enable detailed logging of publications and artifacts:
subprojects {
    afterEvaluate {
        project.publishing.publications.each { publication ->
            println(">>: ${publication}")
            publication.artifacts.each { artifact ->
                println("\t${artifact}")
            }
        }
    }
}

Execute the Gradle command to publish artifacts to Artifactory:

./gradlew reference-db:artifactoryPublish

Expected Behavior

All submodules, regardless of their specific configuration or presence of Java components, should generate and publish .jar artifacts alongside their respective SNAPSHOT versions, module, json, and ivy.xml files.

Actual Behavior

Output for Version 5.1.10

Publications:
>>: org.gradle.api.publish.ivy.internal.publication.DefaultIvyPublication_Decorated@7c0dcfe1
        PublishArtifactBasedIvyArtifact_Decorated reference-db:jar:jar:null
        PublishArtifactBasedIvyArtifact_Decorated reference-db:jar:jar:javadoc
        PublishArtifactBasedIvyArtifact_Decorated reference-db:jar:jar:sources
        FileBasedIvyArtifact_Decorated receipt:json:json:null

Artifacts Deployed:
- reference-db-SNAPSHOT-javadoc.jar
- reference-db-SNAPSHOT-sources.jar
- reference-db-SNAPSHOT.jar
- project-SNAPSHOT.module
- receipt-SNAPSHOT.json
- ivy.xml

Output for Version 5.1.11

Publications:
>>: org.gradle.api.publish.ivy.internal.publication.DefaultIvyPublication_Decorated@4de6e2f3
        FileBasedIvyArtifact_Decorated receipt:json:json:null

Artifacts Deployed:
- project-SNAPSHOT.module
- receipt-SNAPSHOT.json
- ivy.xml

Additional Context

This behavior is observed in projects without Java components.

Environment

Gradle Version: 7.6.4 Operating System: macOs Java Version: Java 11.0.26