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

publishToSonatype not found #1421

Open
t0yv0 opened this issue Aug 30, 2024 · 0 comments
Open

publishToSonatype not found #1421

t0yv0 opened this issue Aug 30, 2024 · 0 comments
Labels
area/codegen Code generation kind/bug Some behavior is incorrect or out of spec

Comments

@t0yv0
Copy link
Member

t0yv0 commented Aug 30, 2024

What happened?

One of our users was confused by this publishing error:

Task ‘publishToSonatype’ not found in root project ‘com.ovh.pulumi’ and its subprojects.”

This happens because the generated Gradle file has conditionals that turn off publishing unless the correct environment variables are setup, it currently reads like this:

if (publishRepoUsername) {
    nexusPublishing {
        repositories {
            sonatype {
                nexusUrl.set(uri(publishRepoURL + "/service/local/"))
                snapshotRepositoryUrl.set(uri(publishRepoURL + "/content/repositories/snapshots/"))
                username = publishRepoUsername
                password = publishRepoPassword
            }
        }
    }
}

if (signingKey) {
    signing {
        useInMemoryPgpKeys(signingKey, signingPassword)
        sign publishing.publications.mainPublication
    }
}

This is rather confusing. Perhaps we could fix this by introducing a pseudo-target in the else case to print out a message indicating that publishing requires environment variables to be set up.

Example

https://github.com/ovh/pulumi-ovh/blob/main/sdk/java/build.gradle#L8

Output of pulumi about

N/A

Additional context

N/A

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).

@t0yv0 t0yv0 added kind/bug Some behavior is incorrect or out of spec needs-triage Needs attention from the triage team labels Aug 30, 2024
@justinvp justinvp added area/codegen Code generation and removed needs-triage Needs attention from the triage team labels Sep 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/codegen Code generation kind/bug Some behavior is incorrect or out of spec
Projects
None yet
Development

No branches or pull requests

2 participants