From 3485dcdc1b7c920e8ac7b38da614c72e2ab8c2fb Mon Sep 17 00:00:00 2001 From: Sumedh Sakdeo Date: Sat, 17 Feb 2024 10:23:10 -0800 Subject: [PATCH 1/5] Maven Pom Metadata --- .../groovy/openhouse.maven-publish.gradle | 50 ++++++++++++++++--- services/housetables/build.gradle | 1 - 2 files changed, 43 insertions(+), 8 deletions(-) diff --git a/buildSrc/src/main/groovy/openhouse.maven-publish.gradle b/buildSrc/src/main/groovy/openhouse.maven-publish.gradle index b78a1a69..b356a37f 100644 --- a/buildSrc/src/main/groovy/openhouse.maven-publish.gradle +++ b/buildSrc/src/main/groovy/openhouse.maven-publish.gradle @@ -2,6 +2,23 @@ plugins { id 'maven-publish' } +task sourcesJar(type: Jar) { + classifier = "sources" + from sourceSets.main.allSource +} + +task javadocJar(type: Jar) { + classifier = "javadoc" + from javadoc.destinationDir +} + +[jar, sourcesJar, javadocJar].each { task -> + task.from(rootDir) { + include 'LICENSE' + include 'NOTICE' + } +} + def pomPath = "$buildDir/${name}.pom" model { tasks.generatePomFileForMavenJavaPublication { @@ -12,15 +29,32 @@ model { } } -java { - withSourcesJar() - withJavadocJar() -} - publishing { publications { mavenJava(MavenPublication) { from components.java + + artifact sourcesJar + artifact javadocJar + + pom { + name = 'OpenHouse' + description = 'Control Plane for Tables in Open Data Lakehouse' + url = 'https://github.com/linkedin/openhouse' + + licenses { + license { + name = 'BSD 2-Clause License' + url = 'https://raw.githubusercontent.com/linkedin/openhouse/main/LICENSE' + } + } + + scm { + connection = 'scm:git:git://github.com/linkedin/openhouse.git' + developerConnection = 'scm:git:ssh://github.com/linkedin/openhouse.git' + url = 'https://github.com/linkedin/openhouse' + } + } } } repositories { @@ -29,6 +63,8 @@ publishing { } artifacts { - archives file: file("$pomPath"), name: "$name", type: "pom" - archives jar, sourcesJar, javadocJar + archives file: file('$pomPath'), name: '$name', type: 'pom' + archives jar + archives sourcesJar + archives javadocJar } \ No newline at end of file diff --git a/services/housetables/build.gradle b/services/housetables/build.gradle index 5faa90af..92d00e93 100644 --- a/services/housetables/build.gradle +++ b/services/housetables/build.gradle @@ -2,7 +2,6 @@ plugins { id 'openhouse.springboot-conventions' id 'openhouse.hadoop-conventions' id 'openhouse.iceberg-conventions' - id 'openhouse.maven-publish' /** * FIXME: Ideally, the below line are also defined in shared buildSrc. But raises following error: * Invalid plugin request [id: 'org.springframework.boot', version: '2.1.2.RELEASE']. From 391aabaae06fc1846c4b32ba22279b5598e41a8b Mon Sep 17 00:00:00 2001 From: Sumedh Sakdeo Date: Sat, 17 Feb 2024 12:25:57 -0800 Subject: [PATCH 2/5] Add maven-publish back to house table service --- .../src/main/groovy/openhouse.springboot-conventions.gradle | 5 +++++ .../main/groovy/openhouse.springboot-ext-conventions.gradle | 5 ----- services/housetables/build.gradle | 4 +++- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/buildSrc/src/main/groovy/openhouse.springboot-conventions.gradle b/buildSrc/src/main/groovy/openhouse.springboot-conventions.gradle index aad94362..b84a832c 100644 --- a/buildSrc/src/main/groovy/openhouse.springboot-conventions.gradle +++ b/buildSrc/src/main/groovy/openhouse.springboot-conventions.gradle @@ -8,6 +8,11 @@ configurations { } } +jar { + enabled = true + archiveClassifier = 'lib' +} + ext { springVersion = '2.6.1' springLog4jVersion = '2.3.4.RELEASE' diff --git a/buildSrc/src/main/groovy/openhouse.springboot-ext-conventions.gradle b/buildSrc/src/main/groovy/openhouse.springboot-ext-conventions.gradle index 913f6ba5..62a21a86 100644 --- a/buildSrc/src/main/groovy/openhouse.springboot-ext-conventions.gradle +++ b/buildSrc/src/main/groovy/openhouse.springboot-ext-conventions.gradle @@ -3,11 +3,6 @@ plugins { id 'openhouse.springboot-conventions' } -jar { - enabled = true - archiveClassifier = 'lib' -} - tasks.named("bootJar") { manifest { // Default springboot app launcher class is JarLauncher which doesn't allow to load classes from external jars diff --git a/services/housetables/build.gradle b/services/housetables/build.gradle index 92d00e93..6a55687e 100644 --- a/services/housetables/build.gradle +++ b/services/housetables/build.gradle @@ -2,12 +2,14 @@ plugins { id 'openhouse.springboot-conventions' id 'openhouse.hadoop-conventions' id 'openhouse.iceberg-conventions' + id 'openhouse.maven-publish' /** * FIXME: Ideally, the below line are also defined in shared buildSrc. But raises following error: * Invalid plugin request [id: 'org.springframework.boot', version: '2.1.2.RELEASE']. * Plugin requests from precompiled scripts must not include a version number. * Please remove the version from the offending request and make sure the module - * containing the requested plugin 'org.springframework.boot' is an implementation dependency.*/ + * containing the requested plugin 'org.springframework.boot' is an implementation dependency. + */ id 'org.springframework.boot' version '2.1.2.RELEASE' /** From 11e53c2ebe060f90829edbc0a81bc69b895b83b8 Mon Sep 17 00:00:00 2001 From: Sumedh Sakdeo Date: Sat, 17 Feb 2024 16:37:01 -0800 Subject: [PATCH 3/5] Bug fix for the groupId for client and tables-test-fixtures --- build.gradle | 2 ++ .../src/main/groovy/openhouse.java-minimal-conventions.gradle | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 1cee2638..3da059f8 100644 --- a/build.gradle +++ b/build.gradle @@ -38,6 +38,8 @@ allprojects { apply plugin: "com.diffplug.spotless" apply plugin: "com.github.spotbugs" + group = 'com.linkedin.openhouse' + repositories { maven { url "https://repo.maven.apache.org/maven2/" diff --git a/buildSrc/src/main/groovy/openhouse.java-minimal-conventions.gradle b/buildSrc/src/main/groovy/openhouse.java-minimal-conventions.gradle index 17c02785..d3534a71 100644 --- a/buildSrc/src/main/groovy/openhouse.java-minimal-conventions.gradle +++ b/buildSrc/src/main/groovy/openhouse.java-minimal-conventions.gradle @@ -4,7 +4,6 @@ plugins { id 'jacoco' } -group = 'com.linkedin.openhouse' sourceCompatibility = '1.8' ext { From 2996dc87632931466108cb9f7eb4745470ded0e2 Mon Sep 17 00:00:00 2001 From: Sumedh Sakdeo Date: Sat, 17 Feb 2024 18:43:58 -0800 Subject: [PATCH 4/5] Bug fix for sprintboot services artifacts --- .../groovy/openhouse.springboot-conventions.gradle | 5 ----- .../openhouse.springboot-ext-conventions.gradle | 14 +++++++++++++- services/housetables/build.gradle | 2 +- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/buildSrc/src/main/groovy/openhouse.springboot-conventions.gradle b/buildSrc/src/main/groovy/openhouse.springboot-conventions.gradle index b84a832c..aad94362 100644 --- a/buildSrc/src/main/groovy/openhouse.springboot-conventions.gradle +++ b/buildSrc/src/main/groovy/openhouse.springboot-conventions.gradle @@ -8,11 +8,6 @@ configurations { } } -jar { - enabled = true - archiveClassifier = 'lib' -} - ext { springVersion = '2.6.1' springLog4jVersion = '2.3.4.RELEASE' diff --git a/buildSrc/src/main/groovy/openhouse.springboot-ext-conventions.gradle b/buildSrc/src/main/groovy/openhouse.springboot-ext-conventions.gradle index 62a21a86..b5243785 100644 --- a/buildSrc/src/main/groovy/openhouse.springboot-ext-conventions.gradle +++ b/buildSrc/src/main/groovy/openhouse.springboot-ext-conventions.gradle @@ -1,8 +1,13 @@ -// plugin for extensible springboot apps +// plugin for extensible springboot services plugins { id 'openhouse.springboot-conventions' } +jar { + enabled = true + archiveClassifier = 'lib' +} + tasks.named("bootJar") { manifest { // Default springboot app launcher class is JarLauncher which doesn't allow to load classes from external jars @@ -12,3 +17,10 @@ tasks.named("bootJar") { attributes ('Main-Class': 'org.springframework.boot.loader.PropertiesLauncher') } } + +configurations { + [apiElements, runtimeElements].each { + it.outgoing.artifacts.removeIf { it.buildDependencies.getDependencies(null).contains(jar) } + it.outgoing.artifact(bootJar) + } +} \ No newline at end of file diff --git a/services/housetables/build.gradle b/services/housetables/build.gradle index 6a55687e..2d862eb3 100644 --- a/services/housetables/build.gradle +++ b/services/housetables/build.gradle @@ -1,5 +1,5 @@ plugins { - id 'openhouse.springboot-conventions' + id 'openhouse.springboot-ext-conventions' id 'openhouse.hadoop-conventions' id 'openhouse.iceberg-conventions' id 'openhouse.maven-publish' From bdc65bd293a75047aa597af3a91135b5c4a64bad Mon Sep 17 00:00:00 2001 From: Sumedh Sakdeo Date: Sun, 18 Feb 2024 19:42:22 -0800 Subject: [PATCH 5/5] Include only bootJar --- housetables-service.Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/housetables-service.Dockerfile b/housetables-service.Dockerfile index dccb36d2..c29c485b 100644 --- a/housetables-service.Dockerfile +++ b/housetables-service.Dockerfile @@ -25,6 +25,7 @@ COPY $JAR_FILES ./ RUN ls ./ RUN find . -name "*-sources.jar" -delete RUN find . -name "*-javadoc.jar" -delete +RUN find . -name "*-lib.jar" -delete # Rename the JAR file. RUN ls ./