How to set nexus repository URL in SBT for sonatypeRelease?

312 views Asked by At

I am trying to make my jar available in maven central .All works fine when I do it manually from nexus repository manager UI. Problem occurs when I try to automate the complete steps using sbt-release plugin .On running sonatypeRelease I see it tries to connect to Nexus repository URL: https://oss.sonatype.org/service/local and later failed to connect throwing below error No credential is found for oss.sonatype.org. Prepare ~/.sbt/(sbt_version)/sonatype.sbt file . In my sonatype.sbt URL I have set below config

credentials += Credentials(
    "Sonatype Nexus Repository Manager",
    "s01.oss.sonatype.org",
    "username",
    "password"

)

I am not sure how can I make sonatypeRelease take the config url instead of default one .I am quite sure this sonatype.sbt is being referenced as publishrelease works and it takes the correct sonatype nexus repository URL. Any help on this would be helpful

1

There are 1 answers

0
Rajesh Kumar Dash On BEST ANSWER

I missed putting these lines in my build.sbt file

sonatypeCredentialHost := "s01.oss.sonatype.org"
sonatypeRepository := "https://s01.oss.sonatype.org/service/local"