Skip to content

Commit c11abfb

Browse files
fix: build gradle publish plugin
1 parent 16e0ef7 commit c11abfb

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

sdk-java/build.gradle

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,13 @@ buildscript {
88
//mavenLocal()
99
}
1010
dependencies {
11-
classpath 'com.vanniktech:gradle-maven-publish-plugin:0.28.0' //for publishing
11+
// Load publish plugin ONLY when publish task is requested
12+
if (gradle.startParameter.taskNames.any { it.toLowerCase().contains("publish") }) {
13+
classpath 'com.vanniktech:gradle-maven-publish-plugin:0.28.0'
14+
println("[INFO] Maven Publish plugin ENABLED (publish task detected).")
15+
} else {
16+
println("[INFO] Maven Publish plugin SKIPPED (no publish task).")
17+
}
1218
}
1319
}
1420

@@ -28,4 +34,7 @@ dependencies {
2834
//testImplementation 'com.squareup.okhttp3:mockwebserver:3.7.0'
2935
}
3036

31-
apply plugin: "com.vanniktech.maven.publish"
37+
if (gradle.startParameter.taskNames.any { it.toLowerCase().contains("publish") }) {
38+
apply plugin: "com.vanniktech.maven.publish"
39+
println("[INFO] Maven Publish plugin APPLIED (publish task detected).")
40+
}

0 commit comments

Comments
 (0)