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

Gradle metadata not published by artifactory gradle plugin #247

Closed
bclozel opened this issue Sep 4, 2019 · 6 comments
Closed

Gradle metadata not published by artifactory gradle plugin #247

bclozel opened this issue Sep 4, 2019 · 6 comments
Assignees

Comments

@bclozel
Copy link

bclozel commented Sep 4, 2019

As of Gradle 5.3, we can now publish Gradle metadata with our build. Right now, one needs to enable this feature with enableFeaturePreview("GRADLE_METADATA").

I'm using Gradle 5.6.1 and artifactory plugin 4.9.8 with a publication setup. The module.json are generated during the build (and they can be seen in build/publications/mavenJava/ for each module. As advised by Gradle developers I'm publishing porper software components as well.

You can more details about my setup here and here, but basically:

// using a software component in the publication setup
publishing {
	publications {
		mavenJava(MavenPublication) {
			from components.java
			artifact sourcesJar
			artifact javadocJar
		}
	}
}

// publishing the maven publication for each project
artifactoryPublish {
	publications(publishing.publications.mavenJava)
}

The build log shows that now both generateMetadataFileForMavenJavaPublication and generatePomFileForMavenJavaPublication tasks are running before the artifactoryPublish task, but the module.json is not pushed to the artifact repository by the artifactoryDeploy task.

Is this feature supported by the artifactory gradle plugin?
Am I missing an experimental flag or some specific configuration on my side?

@ljacomet
Copy link
Contributor

ljacomet commented Sep 6, 2019

Gradle 6.0 will no longer require the feature preview flag to produce the Gradle Module Metadata as it will become the default.
It would be awesome if that new file was published by this plugin.

@ansman
Copy link

ansman commented Sep 25, 2019

This is increasingly important as Kotlin Multiplatform requires the .module files to be publishes along with the standard POM and binary file.

@ljacomet
Copy link
Contributor

ljacomet commented Oct 9, 2019

I am working on a PR to address this

ljacomet added a commit to ljacomet/build-info that referenced this issue Oct 9, 2019
This fixes for example the publication of Gradle Module Metadata,
stable since Gradle 5.3 and produced by default with Gradle 6.0.

Issue jfrog#247
ljacomet added a commit to ljacomet/build-info that referenced this issue Oct 9, 2019
This now leverages the APIs on MavenNormalizedPublication to make sure
all artifacts are published.
This fixes for example the publication of Gradle Module Metadata,
stable since Gradle 5.3 and produced by default with Gradle 6.0.

Fixes jfrog#247
ljacomet added a commit to ljacomet/build-info that referenced this issue Oct 9, 2019
This now leverages the APIs on MavenNormalizedPublication to make sure
all artifacts are published.
This fixes for example the publication of Gradle Module Metadata,
stable since Gradle 5.3 and produced by default with Gradle 6.0.

Fixes jfrog#247
ljacomet added a commit to ljacomet/build-info that referenced this issue Oct 16, 2019
A Maven publication does not always have a main artifact.

Issue jfrog#247
@yahavi
Copy link
Member

yahavi commented Oct 28, 2019

#265 had been merged. Thanks @ljacomet!
@bclozel, @ansman,
A snapshot is available in oss.jfrog.org. To test it, use the following configuration in your build.gradle file:

buildscript {
    repositories {
        maven { url "https://oss.jfrog.org/oss-snapshot-local" }
        jcenter()
    }
    dependencies {
        classpath(group: 'org.jfrog.buildinfo', name: 'build-info-extractor-gradle', version: '4.9.x-SNAPSHOT')
    }
}

We'll appreciate you feedback for that!

@yahavi yahavi self-assigned this Oct 28, 2019
@yahavi
Copy link
Member

yahavi commented Nov 24, 2019

@bclozel @ansman
Gradle Artifactory 4.11.0 is released.
This release includes this PR. Thanks @ljacomet!
Feel free to upgrade.

@bclozel
Copy link
Author

bclozel commented May 10, 2020

This has been fixed. Thanks!

@bclozel bclozel closed this as completed May 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants