Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maven and Ivy publishing should support append information for artifact PUT URL #9218

Open
rpalcolea opened this issue Apr 24, 2019 · 3 comments
Labels
a:feature A new functionality in:publishing-plugins ivy-publish maven-publish

Comments

@rpalcolea
Copy link
Contributor

Given a build file as follows:

plugins {
    id 'java-library'
    id 'maven-publish'
}

repositories {
    jcenter()
}

dependencies {
     api 'com.google.truth:truth:0.28'
}

publishing {
    publications {
        maven(MavenPublication) {
            from components.java
            versionMapping {
                allVariants{
                    fromResolutionResult()
                }
            }
        }
    }
    repositories {
        maven {
            url = http://localhost:33138/artifactory/libs-releases-local-pom
        }
    }
}

And deploying this, results in output similar to:

Deploying to http://localhost:33138/artifactory/libs-releases-local-pom
Uploading: test/nebula/netflix/publishes-to-repositories/1.0.0/publishes-to-repositories-1.0.0.jar to repository remote at http://localhost:33138/artifactory/libs-releases-local-pom/
Uploading: test/nebula/netflix/publishes-to-repositories/1.0.0/publishes-to-repositories-1.0.0.pom to repository remote at http://localhost:33138/artifactory/libs-releases-local-pom/
Uploading: test/nebula/netflix/publishes-to-repositories/1.0.0/publishes-to-repositories-1.0.0.module to repository remote at http://localhost:33138/artifactory/libs-releases-local-pom/

It would be useful if we could provide extra parameters for generated PUT URLs. For example:

http://localhost:33138/artifactory/libs-releases-local-pom/test/netflix/nebula/publishes-to-repositories/1.0.0/publishes-to-repositories-1.0.0.jar;build.timestamp=1556142653890;build.name=publishes-to-repositories;build.version=1.0.0;build.status=release;build.number=1

Adding such parameters to the URL when publishing to artifactory, enable us to make a relationship between a build and the published artifacts.

Currently, in order to publish to Artifactory using Maven or Ivy publish plugins, an extra step is needed per published module, which is updating artifact properties -> https://www.jfrog.com/confluence/display/RTF/Artifactory+REST+API#ArtifactoryRESTAPI-SetItemProperties

While this works, this increases the number of http request to release artifacts with build information (https://www.jfrog.com/confluence/display/RTF/Artifactory+REST+API#ArtifactoryRESTAPI-BuildUpload).

Omitting this information, generates an empty relationship between build and artifacts at Artifactory level. Example:

Screen Shot 2019-04-24 at 8 30 28 AM

While I understand that this is a specific Artifactory capability, it would be nice if Gradle provided a mechanism to add things to the upload URLs in order to reduce network traffic.

@rpalcolea rpalcolea added the a:feature A new functionality label Apr 24, 2019
@rpalcolea rpalcolea changed the title Maven and Ivy publishing should support parameters for artifact PUT URL Maven and Ivy publishing should support append information for artifact PUT URL Apr 25, 2019
@rpalcolea
Copy link
Contributor Author

Hi @ljacomet , is this something that you folks are planning for Gradle 6.0? it seems like having an API to configure those extra parameters would be helpful.

Still unclear to me where this should live... repository level or publication level. It seems like publication is the way to go. But wondering if it should be part of MavenPublication and IvyPublication.

Thoughts on this?

@ljacomet ljacomet added the @jvm label Feb 17, 2020
@stale
Copy link

stale bot commented Feb 17, 2021

This issue has been automatically marked as stale because it has not had recent activity. Given the limited bandwidth of the team, it will be automatically closed if no further activity occurs. If you're interested in how we try to keep the backlog in a healthy state, please read our blog post on how we refine our backlog. If you feel this is something you could contribute, please have a look at our Contributor Guide. Thank you for your contribution.

@stale stale bot added the stale label Feb 17, 2021
@rpalcolea
Copy link
Contributor Author

Would be great to touch base on this one

@stale stale bot removed the stale label Feb 17, 2021
@jjohannes jjohannes removed the @jvm label Mar 22, 2021
@octylFractal octylFractal added in:publishing-plugins ivy-publish maven-publish and removed in:dependency-management DO NOT USE labels Nov 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:feature A new functionality in:publishing-plugins ivy-publish maven-publish
Projects
None yet
Development

No branches or pull requests

4 participants