diff --git a/build.gradle b/build.gradle index 9d64d977..671133b1 100644 --- a/build.gradle +++ b/build.gradle @@ -21,16 +21,6 @@ apply from: "spotless.gradle" subprojects { apply from: "$rootDir/gradle/build-conventions.gradle" - - // Skip Javadoc for demo modules - if (project.path.startsWith(':demos:')) { - tasks.withType(Javadoc) { - onlyIf { false } - } - tasks.matching { it.name == 'javadocJar' }.configureEach { - onlyIf { false } - } - } } tasks.register('aggregateTestReport', TestReport) { diff --git a/gradle/build-conventions.gradle b/gradle/build-conventions.gradle index d3ad8e0c..45dbb867 100644 --- a/gradle/build-conventions.gradle +++ b/gradle/build-conventions.gradle @@ -8,8 +8,12 @@ java { } sourceCompatibility = JavaVersion.VERSION_17 targetCompatibility = JavaVersion.VERSION_17 - withJavadocJar() - withSourcesJar() + + // Only generate javadoc and sources JARs for non-demo modules + if (!project.path.startsWith(':demos:')) { + withJavadocJar() + withSourcesJar() + } } test { @@ -36,58 +40,61 @@ dependencies { testImplementation "com.redis:testcontainers-redis:${testcontainersRedisVersion}" } -publishing { - publications { - mavenJava(MavenPublication) { - from components.java - groupId = project.group - artifactId = project.name - version = project.version - description = project.description +// Only configure publishing for non-demo modules +if (!project.path.startsWith(':demos:')) { + publishing { + publications { + mavenJava(MavenPublication) { + from components.java + groupId = project.group + artifactId = project.name + version = project.version + description = project.description - versionMapping { - usage('java-api') { - fromResolutionOf('runtimeClasspath') - } - usage('java-runtime') { - fromResolutionResult() + versionMapping { + usage('java-api') { + fromResolutionOf('runtimeClasspath') + } + usage('java-runtime') { + fromResolutionResult() + } } - } - pom { - packaging = 'jar' - name = project.name - description = project.description - url = "https://github.com/redis/redis-om-spring" - inceptionYear = '2021' + pom { + packaging = 'jar' + name = project.name + description = project.description + url = "https://github.com/redis/redis-om-spring" + inceptionYear = '2021' - licenses { - license { - name = "MIT License" - url = "https://opensource.org/licenses/MIT" + licenses { + license { + name = "MIT License" + url = "https://opensource.org/licenses/MIT" + } } - } - developers { - developer { - id = "bsbodden" - name = "Brian Sam-Bodden" - email = "bsb at redis.com" + developers { + developer { + id = "bsbodden" + name = "Brian Sam-Bodden" + email = "bsb at redis.com" + } } - } - scm { - connection = "scm:git:git://github.com/redis/redis-om-spring.git" - developerConnection = "scm:git:ssh://github.com/redis/redis-om-spring.git" - url = "https://github.com/redis/redis-om-spring" + scm { + connection = "scm:git:git://github.com/redis/redis-om-spring.git" + developerConnection = "scm:git:ssh://github.com/redis/redis-om-spring.git" + url = "https://github.com/redis/redis-om-spring" + } } } } - } - repositories { - maven { - url = rootProject.layout.buildDirectory.dir('staging-deploy') + repositories { + maven { + url = rootProject.layout.buildDirectory.dir('staging-deploy') + } } } }