I'm using the maven-publish
plugin in my Gradle build. When my project's version
includes -SNAPSHOT
(eg, 1.3-SNAPSHOT
), it publishes with a generated version, like foo-1.3-20230418.171737-3.war
.
How can I customize the snapshot version suffix ("20230418.171737-3" in the sample above)? For example, I might want just the date and a simple sequential number, like 1.3-20210418-1
.
Relevant portions of my build.gradle
:
plugins {
id 'maven-publish'
}
publishing {
repositories {
maven {
name = 'GitHubPackages'
url = uri("https://maven.pkg.github.com/myorg/myrepo")
credentials {
username = project.findProperty("githubpackages.user")
password = project.findProperty("githubpackages.token")
}
}
}
publications {
webApp(MavenPublication) {
artifact bootWar
groupId = 'com.me'
artifactId = 'foo'
}
}
}