question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Gradle metadata not published by artifactory gradle plugin

See original GitHub issue

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?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
yahavicommented, Oct 28, 2019

https://github.com/jfrog/build-info/pull/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!

0reactions
bclozelcommented, May 10, 2020

This has been fixed. Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Gradle Artifactory Plugin - JFrog - JFrog Documentation
The Gradle Artifactory Plugin allows you to define different publication configuration for sub projects. You may also define the configuration ...
Read more >
Understanding Gradle Module Metadata - Gradle User Manual
Gradle Module Metadata is automatically published when using the Maven Publish plugin or the Ivy Publish plugin. The specification for Gradle Module Metadata ......
Read more >
Gradle is not uploading artifact to artifactory - Stack Overflow
The Gradle Artifactory plugin should be told which publish configuration would be uploaded. In your case, you can add the default 'archives' ...
Read more >
Publish Artifacts from a Gradle Project - JetBrains
Publish Maven artifacts using Gradle command-line tool · Open the project's build.gradle file. · Add the reference to the Maven plugin: · In...
Read more >
Publishing Kotlin Multiplatform Artifacts to Artifactory (Maven)
This enables Gradle metadata, which is the dark magic that allows each ... The Maven publish plugin will configure the artifacts so they...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found