Hello,
I am new to gradle and try to publish my artifacts to nexus. I found the maven-publish plugin for this but I didn’t get it working.
Here is my configuration from build.gradle:
publishing {
repositories {
maven {
url "$baseurl/pws-${project.version.endsWith('-SNAPSHOT') ? 'snapshots' : 'releases' }"
credentials {
username '$nexusUser'
password '$nexusPassword'
}
}
}
}
publishing {
publications {
mavenJava(MavenPublication) {
groupId 'com.my.group.id'
artifactId 'artifactId'
version '0.0.1-SNAPSHOT'
}
}
}
Whenever I run the task “publish” I get the following error:
Failed to publish publication ‘mavenJava’ to repository ‘maven’
> Failed to retrieve remote metadata com.my.group.id:artifactId:0.1-SNAPSHOT/maven-metadata.xml: Could not transfer metadata com.my.group.id:artifactId:0.1-SNAPSHOT/maven-metadata.xml from/to remote (http://xxxx/xxxxx): Could not get resource ‘com/my/group/id/artifactId/0.1-SNAPSHOT/maven-metadata.xml’
The maven-metadata.xml is not uploaded but I don’t know why.
There is no return value or another error which indicates the problem. Have someone an idea whats going wrong here?
Thanks in advanced
Tobi