Skip to content

Commit 38196e7

Browse files
committed
Fix undefined version name when publishing to sonatype
1 parent 1e1f521 commit 38196e7

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

build.gradle

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,12 @@ nexusPublishing {
3232
}
3333

3434
allprojects {
35-
group 'com.github.tschuchortdev'
35+
// The maven-publish plugin seems to be able to find the group and version name by itself
36+
// but the gradle-nexus publish-plugin can not do this. It is very important to set
37+
// group and version on the _root_ project or the version name used for publishing
38+
// to sonatype will be undefined
39+
group = GROUP
40+
version = VERSION_NAME
3641

3742
buildscript {
3843
repositories {
@@ -125,15 +130,6 @@ subprojects {
125130
}
126131
}
127132
}
128-
repositories {
129-
maven {
130-
credentials {
131-
username "$System.env.SONATYPE_NEXUS_USERNAME"
132-
password "$System.env.SONATYPE_NEXUS_PASSWORD"
133-
}
134-
url = VERSION_NAME.endsWith('SNAPSHOT') ? SNAPSHOT_REPOSITORY : RELEASE_REPOSITORY
135-
}
136-
}
137133
}
138134

139135
signing {

0 commit comments

Comments
 (0)