pulumi / pulumi/pulumi-java

Third-Party Publishers - Pom misses package name

Open
#1,406 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area/codegen kind/bug
Dominant language
Java
Stars
85
Forks
26
Avg merge
11h 49m
Merged PRs (30d)
22

Description

What happened?

When publishing to Sonatype, I cannot close the staging repository and publish to public because of a Pom error.

Looking at the generated build.gradle file, I see that pom.name = "" which should ideally be the package name as for Pulumi published packages.

Example
publishing {
    publications {
        mainPublication(MavenPublication) {
            groupId = "io.muehlbachler.pulumi"
            artifactId = "proxmoxve"
            version = resolvedVersion
            from components.java
            artifact sourcesJar
            artifact javadocJar

            pom {
                inceptionYear = ""
                name = "" <- THIS IS MISSING
                packaging = "jar"
                description = "A Pulumi package for creating and managing Proxmox Virtual Environment cloud resources."

                url = "https://github.com/muhlba91/pulumi-proxmoxve"

                scm {
                    connection = "git@github.com/muhlba91/pulumi-proxmoxve.git"
                    developerConnection = "git@github.com/muhlba91/pulumi-proxmoxve.git"
                    url = "https://github.com/muhlba91/pulumi-proxmoxve"
                }

                licenses {
                    license {
                        name = "The Apache License, Version 2.0"
                        url = "http://www.apache.org/licenses/LICENSE-2.0.txt"
                    }
                }

                developers {
                    developer {
                        id = ""
                        name = ""
                        email = ""
                    }
                }
            }
        }
    }
}
Output of pulumi about

N/A

Additional context

This is related to https://github.com/pulumi/pulumi-java/blob/main/pkg/codegen/java/templates_gradle.go#L129-L136 where the project name, as well as other properties like the inception year, are only set for Pulumi published packages.
For third-party publishers this needs to be set as well accordingly. I believe it would make sense to set most, if not all, of these properties that are currently hard-coded only for Pulumi published packages.

Contributing

Vote on this issue by adding a 👍 reaction.
To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in pkg/codegen/java/templates_gradle.go around lines 129-136 and compare the Pulumi-published and third-party publisher paths. Check how the generated build.gradle populates MavenPublication pom fields, then verify that the third-party output includes the package name and the intended metadata.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system, tooling
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.