我发布了这个解决方案:https :
//discuss.gradle.org/t/2-8-2-9-mavendeployer-doesnt-honour-uniqueversion-false-in-maven-uploadarchives/13370/8 我遇到的问题是多个出版部分的出版物。我的解决方案是将额外的工件添加到一个出版物中。然后所有的项目,api jar、source jar、api source jar 和 main jar 都具有相同的 SNAPSHOT 时间戳。这似乎为我自动处理了 build.timestamp。
task apiJar(type: Jar) {
classifier = 'api'
from(sourceSets.main.output) {
include "com/company/app/dto/**"
}
}
task sourceJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
task apiSourceJar(type: Jar, dependsOn: classes) {
classifier = 'api-sources'
from(sourceSets.main.allSource) {
include "com/company/app/dto/**"
}
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
pom.withXml {
asNode().appendNode('description', 'APP Sprint Boot App')
}
artifact apiJar
artifact sourceJar
artifact apiSourceJar
}
}
repositories {
maven {
credentials {
username = 'username'
password = 'password'
}
if(project.version.endsWith('-SNAPSHOT')) {
url "http://server:9081/artifactory/libs-snapshot-local"
} else {
url "http://server:9081/artifactory/libs-release-local"
}
}
}
}