Use java-library plugin and api configuration for correct POM scopes#470
Merged
cbb330 merged 1 commit intolinkedin:mainfrom Feb 24, 2026
Merged
Conversation
Switch base convention from java to java-library and promote consumer-facing dependencies from implementation to api. This ensures published POMs use compile scope for transitive dependencies that downstream consumers need at compile time, fixing broken resolution when artifacts are consumed via standard Maven/Gradle resolution (e.g. mavenLocal) rather than LinkedIn's li-product plugin which ignores POM scopes. Dependencies kept as implementation (runtime scope in POM): - testcontainers, H2, logging implementations, OkHttp, OpenTelemetry SDK, Kotlin stdlib, Livy, Netty, springdoc, spotbugs-annotations, JAXB runtime, MySQL connector, cron-utils, commons-cli, gson
jiang95-dev
approved these changes
Feb 24, 2026
Collaborator
jiang95-dev
left a comment
There was a problem hiding this comment.
This is cool! I had to manually convert the pom during local testing, but now it is not needed!
17 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fix published POM metadata so that OpenHouse artifacts work correctly when consumed via standard
Maven/Gradle resolution (e.g.
publishToMavenLocal+mavenLocal()repository). Currently alltransitive dependencies in published POMs have
<scope>runtime</scope>, making them invisible atcompile time to standard consumers. LinkedIn's
li-productplugin masks this by ignoring POM scopeswhen resolving from Artifactory.
The fix switches the base convention from the
javaplugin tojava-library(a backward-compatiblesuperset) and promotes consumer-facing dependencies from
implementationtoapi, which maps to<scope>compile</scope>in generated POMs. Internal/optional dependencies (testcontainers, H2,logging, OkHttp, Livy, springdoc, etc.) remain as
implementation(runtimescope).Changes
Bug Fix: All 16
build.gradleand convention plugin files updated:buildSrc/src/main/groovy/openhouse.java-minimal-conventions.gradle:java→java-library, mapstruct + servlet-api →apibuildSrc/src/main/groovy/openhouse.java-conventions.gradle: micrometer deps →apibuildSrc/src/main/groovy/openhouse.hadoop-conventions.gradle: hadoop-client + commons-lang3 →apibuildSrc/src/main/groovy/openhouse.iceberg-conventions-1.5.2.gradle: iceberg deps →apibuildSrc/src/main/groovy/openhouse.iceberg-conventions-1.2.gradle: iceberg deps →apibuildSrc/src/main/groovy/openhouse.iceberg-aws-conventions.gradle: iceberg-aws + AWS SDK →apibuildSrc/src/main/groovy/openhouse.iceberg-azure-conventions.gradle: azure deps →apibuildSrc/src/main/groovy/openhouse.springboot-conventions.gradle: Spring starters, swagger, servlet-api →apicluster/storage/build.gradle,cluster/metrics/build.gradle,client/secureclient/build.gradle: project deps →apiservices/common/build.gradle,services/tables/build.gradle,services/housetables/build.gradle,services/jobs/build.gradle,iceberg/openhouse/internalcatalog/build.gradle: project deps and consumer-facing libs →apiTesting Done
Build verification:
./gradlew compileJavapasses across all 73 tasks.POM verification: After
./gradlew publishToMavenLocal, inspected POMs in~/.m2/repository/com/linkedin/openhouse/:<scope>compile</scope>(e.g. storage module: 20 compile-scope deps)<scope>runtime</scope>(e.g. storage module: 3 runtime-scope deps — gson, commons-cli, testcontainers)End-to-end verification: li-openhouse builds successfully against locally-published SNAPSHOT artifacts using
mavenLocal()— previously failed with missing compile-time types (Spring, Iceberg, slf4j).Additional Information
Backward Compatibility
These changes are fully backward compatible:
java-libraryis a strict superset ofjava— it adds theapiconfiguration but doesn't remove or change anything from thejavaplugin. All existing build logic, tasks, and configurations continue to work identically.JAR contents are identical — the compiled bytecode doesn't change at all.
apivsimplementationonly affects how Gradle exposes dependencies to consumers; it has zero effect on what gets compiled into the module's own JAR.Fat JARs (bootJar) are identical — Spring Boot's repackaging bundles all dependencies regardless of scope, so the deployed services contain exactly the same classes.
POM metadata is the only thing that changes — dependencies that were
<scope>runtime</scope>are now<scope>compile</scope>for consumer-facing deps. This is strictly more correct — it can only fix resolution for standard consumers, never break it. A dependency that was already visible at runtime remains visible; it's now also visible at compile time.li-product consumers are unaffected — LinkedIn's li-product plugin ignores POM scopes entirely when resolving from Artifactory, so the existing internal build pipeline sees no difference.