Closed a914-gowtham closed 3 years ago
Your Gradle code seems correct. However it seems you did not provide your maven credentials correctly.
In the README (https://github.com/vanniktech/gradle-maven-publish-plugin#where-to-upload-to), it is stated that you need to set the Gradle properties mavenCentralUsername
and mavenCentralPassword
to be set to be able to upload to Maven Central.
It is recommended to set them in ~/.gradle/gradle.properties
.
If you do not have these credentials yet, check out how to ask SonaType to create a free repository for your OSS. You will need to prove you are the owner of gowtham.com. If you can't, checkout GitHub Packages and their offer of per-project Maven repositories.
@victorpaleologue There is no file named gradle.properties under gradle folder. should I create one? and I have some other data as well. where do i have to set them.
signing.keyId=myKeyId
signing.password=password
signing.secretKeyRingFile=gpg-keys/myKeyId.gpg
mavenCentralUsername=Gowtham24
mavenCentralPassword=myPassword
Yes, precisely in ~/.gradle/gradle.properties
. ~
stands for your home folder, and not the root of your project.
So do not confuse it with the gradle
folder of your project.
Also, beware of not sharing your keyring password here!
Thanks a lot that helped to solve. but I got another error. Is this same as yours issue which you created lastly
> Task :library:signMavenPublication FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':library:signMavenPublication'.
> Cannot perform signing task ':library:signMavenPublication' because it has no configured signatory
I understand that I need to give credentials for sonatype account. but, I don't know where to give it. an example code be helpful
Error log
library/gradle.properties
build.gradle(project)
build.gradle(library)