gradle-nexus / publish-plugin

Gradle plugin for publishing to Nexus repositories
Apache License 2.0
401 stars 29 forks source link

ERROR: Extension with name 'nexusPublishing' does not exist. #104

Open oshai opened 3 years ago

oshai commented 3 years ago

I am trying to use the plugin to deploy to maven central (now that jcenter is gone). I am getting the following error on build:

* Where:
Build file '/Volumes/case_sensitive/github/jasync-sql/build.gradle.kts' line: 142

* What went wrong:
Extension with name 'nexusPublishing' does not exist. Currently registered extension names: [ext, kotlin, kotlinTestRegistry, defaultArtifacts, sourceSets, reporting, java, javaInstalls, javaToolchains, publishing, jacoco, ktlint]

To reproduce it I upload the code with changes to a branch: https://github.com/jasync-sql/jasync-sql/tree/publish-plugin

Thanks in advance!

szpak commented 3 years ago

Move:

    nexusPublishing {
            repositories {
                sonatype()
            }
    }

from the allprojects {} block to the root project.

oshai commented 3 years ago

Thanks, that worked! (I think I tried it initially and it didn't, but probably my mistake). I still have a problem in the repo upload. I think for some reason the version is not configured correctly (shows as unspecified)

image

oshai commented 3 years ago

I moved the version to the all project section and it looks better.

I still have an issue with signing the artifacts. Should I do it with another plugin? I saw issue #85 which hints I should, but the docs don't explain how to integrate it. Another plugin I saw is much more specific about how to do that: https://github.com/vanniktech/gradle-maven-publish-plugin#signing

I think I figured out I should use the signing plugin, so I will try that. But I think it will be nice if this plugin will deal with that or explain it in the docs.