Skip to content

Commit fbcb8dd

Browse files
committed
fix mavenCentralPublish.gradle version determination
1 parent f5f2156 commit fbcb8dd

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

gradle/scripts/mavenCentralPublish.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ task javadocJar(type: Jar, dependsOn: javadoc) {
1212
if (project.hasProperty('user') && project.hasProperty('password')) {
1313

1414
// snapshot version differs from normal version
15-
def version = project.hasProperty('snapshot') ? "${semver.major}.${semver.minor}-SNAPSHOT" : this.version
15+
String versionString = project.hasProperty('snapshot') ? "${semver.major}.${semver.minor}-SNAPSHOT" : this.version.toString()
1616

1717
signing {
18-
required { !version.endsWith('SNAPSHOT') }
18+
required { !versionString.endsWith('SNAPSHOT') }
1919
if (required)
2020
sign(publishing.publications)
2121
}
@@ -80,7 +80,7 @@ if (project.hasProperty('user') && project.hasProperty('password')) {
8080
removeTestDependenciesFromPom(pom)
8181
groupId group
8282
artifactId 'PowerSystemDataModel'
83-
version version
83+
version versionString
8484

8585
from components.java
8686
artifact sourcesJar
@@ -92,7 +92,7 @@ if (project.hasProperty('user') && project.hasProperty('password')) {
9292
maven {
9393
def releasesRepoUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
9494
def snapshotsRepoUrl = "https://oss.sonatype.org/content/repositories/snapshots/"
95-
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
95+
url = versionString.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
9696
credentials {
9797
username project.getProperty('user')
9898
password project.getProperty('password')

0 commit comments

Comments
 (0)