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

MavenNebulaPublishPlugin: support java platform plugin publications #195

Merged
merged 1 commit into from
Mar 20, 2025

Conversation

rpalcolea
Copy link
Member

Today, folks using our plugin with java-platform need to do the following to publish a BOM:

class PublishMavenPlatformPlugin implements Plugin<Project> {

    @Override
    void apply(Project project) {
        project.plugins.apply(MavenPublishPlugin)
        project.afterEvaluate {
            project.extensions.findByType(PublishingExtension).with {
                publications { PublicationContainer pc ->
                    pc.removeAll()
                    pc.getByName('nebula') { MavenPublication p ->
                        p.from(project.components.getByName('javaPlatform'))
                        p.versionMapping { VersionMappingStrategy v ->
                            v.allVariants { VariantVersionMappingStrategy vv ->
                                vv.fromResolutionResult()
                            }
                        }
                    }
                }
            }
        }
    }
}

This should take care of this boilerplate

@rpalcolea rpalcolea force-pushed the maven/support-publishing-platforms branch from e5bbc73 to c3af94e Compare March 20, 2025 21:59
@rpalcolea rpalcolea merged commit 61e8341 into main Mar 20, 2025
6 checks passed
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

Successfully merging this pull request may close these issues.

None yet

1 participant