运行gradle发布步骤时,我的circleci构建出现错误。我正在使用gradle 5.3,并且意识到他们已经在5.4.1中更改了此功能。但是,我不明白为什么在我使用的版本中此操作失败。
group = 'com.talentreef.notification.commons'
version = '1.0.0-SNAPSHOT'
publishing {
publications {
maven(MavenPublication) {
from components.java
}
}
repositories {
maven {
def releaseRepoUrl = "https://nexus.trdev.co/nexus/content/repositories/releases"
def snapshotRepoUrl = "https://nexus.trdev.co/nexus/content/repositories/snapshots"
url = version.endsWith('SNAPSHOT') ? snapshotRepoUrl : releaseRepoUrl
credentials {
username = rootProject.ext.nexus.username
password = rootProject.ext.nexus.password
}
}
}
}
* What went wrong:
Execution failed for task ':publishMavenPublicationToMavenRepository'.
> Failed to publish publication 'maven' to repository 'maven'
> Could not write to resource 'https://nexus.trdev.co/nexus/content/repositories/snapshots/com/talentreef/notification/commons/notification-commons/1.0.0-SNAPSHOT/notification-commons-1.0.0-20190619.182943-1.jar'.
> Could not PUT 'https://nexus.trdev.co/nexus/content/repositories/snapshots/com/talentreef/notification/commons/notification-commons/1.0.0-SNAPSHOT/notification-commons-1.0.0-20190619.182943-1.jar'. Received status code 400 from server: Bad Request
好的,因此似乎失败了,因为存储库是策略类型“发布”而不是快照。