kotlingradlemaven-central

Publishing a Java library using JReleaser - maven.nexus2.mavenCentral.stagingRepository does not exist


I have the following config:

jreleaser {
    gitRootSearch = true
    signing {
        active.set(Active.ALWAYS)
        armored.set(true)
    }
    deploy {
        maven {
            nexus2 {
                create("mavenCentral") {
                    active.set(Active.ALWAYS)
                    url.set("https://s01.oss.sonatype.org/service/local")
                    snapshotUrl.set("https://s01.oss.sonatype.org/content/repositories/snapshots/")
                    closeRepository.set(true)
                    releaseRepository.set(true)
                    stagingRepository("target/staging-deploy")
                }
            }
        }
    }
}

I get this:

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':lib:jreleaserFullRelease'.
> maven.nexus2.mavenCentral.stagingRepository does not exist: target/staging-deploy

(There are barely any tutorials on this, especially for Gradle with Kotlin DSL. I found only for Maven which was already helpful)

What is stagingRepository supposed to mean? (I can also post the publishing part if needed.)


Solution

  • The stagingRepository is a local directory that contains artifacts to be deployed. Its use is explained at the official guide.