I am currently having a problem when publishing a Gradle build to a snapshot Artifactory repository where 'SNAPSHOT' is not being resolved to a timestamp. The jars can be found on the repo but are in the format of '1.0.1-SNAPSHOT.jar' instead of e.g. '1.0.1-20180420.112216-1.jar'. This is causing problems when other builds depend on the project in question. We currently have Maven builds which are pushing to the same repo without any problems.
I am using the maven-publish and com.jfrog.artifactory plugins. It is worth mentioning that I don't have a lot of Gradle experience.
Relevant pieces from build.gradle:
apply plugin: 'java'
apply plugin: 'maven-publish'
apply plugin: 'com.jfrog.artifactory'
artifactory {
contextUrl = ${rep.url}
publish {
ext.systemProperties = System.getenv()
println "Publishing using this user: ${systemProperties.artifactory_user}"
println "Publishing to this repo: ${systemProperties.artifactory_repo}"
repository {
repoKey = "${systemProperties.artifactory_repo}"
username = "${systemProperties.artifactory_user}"
password = "${systemProperties.artifactory_password}"
maven = true
}
defaults {
publications('mavenJava')
}
}
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
}
}
}
relevant from gradle-wrapper.properties:
distributionUrl=https\://services.gradle.org/distributions/gradle-4.0.2-bin.zip
Environment variables come from Jenkins and are the same used in our maven builds.