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

Do not publish Gradle module metadata #127

Merged
merged 2 commits into from
Jan 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import org.gradle.api.plugins.GroovyPlugin
import org.gradle.api.publish.PublishingExtension
import org.gradle.api.publish.maven.MavenPublication
import org.gradle.api.publish.maven.plugins.MavenPublishPlugin
import org.gradle.api.publish.tasks.GenerateModuleMetadata
import org.gradle.api.tasks.SourceSet
import org.gradle.api.tasks.TaskProvider
import org.gradle.api.tasks.bundling.Jar
Expand Down Expand Up @@ -366,6 +367,14 @@ class JpiPlugin implements Plugin<Project> {
}

private static configurePublishing(Project project) {
// Disable publication of Gradle module metadata
// Currently, this would produce a module metadata file which can't be consumed by downstream projects,
// since it doesn't contain any dependencies and only the hpi variant and not jar variant.
// Until this is fixed, Gradle module metadata shouldn't be published.
project.tasks.withType(GenerateModuleMetadata) {
enabled = false
}

JpiExtension jpiExtension = project.extensions.getByType(JpiExtension)

// delay configuration until all settings are available (groupId, shortName, ...)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,14 +160,15 @@ class JpiIntegrationSpec extends IntegrationSpec {
result.task(dependency).outcome == outcome

where:
task | dependency | outcome
'jar' | ':configureManifest' | TaskOutcome.SUCCESS
'war' | ':configureManifest' | TaskOutcome.SUCCESS
'processTestResources' | ':resolveTestDependencies' | TaskOutcome.NO_SOURCE
'jpi' | ':war' | TaskOutcome.SUCCESS
'compileTestJava' | ':insertTest' | TaskOutcome.SKIPPED
'testClasses' | ':generate-test-hpl' | TaskOutcome.SUCCESS
'compileJava' | ':localizer' | TaskOutcome.SUCCESS
task | dependency | outcome
'jar' | ':configureManifest' | TaskOutcome.SUCCESS
'war' | ':configureManifest' | TaskOutcome.SUCCESS
'processTestResources' | ':resolveTestDependencies' | TaskOutcome.NO_SOURCE
'jpi' | ':war' | TaskOutcome.SUCCESS
'compileTestJava' | ':insertTest' | TaskOutcome.SKIPPED
'testClasses' | ':generate-test-hpl' | TaskOutcome.SUCCESS
'compileJava' | ':localizer' | TaskOutcome.SUCCESS
'generateMetaFileForMavenJpiPub' | ':generateMetadataFileForMavenJpiPublication' | TaskOutcome.SKIPPED
}

@Unroll
Expand Down