Skip to content

Commit 3a039b7

Browse files
Fix unresolvable 3.3.2 Maven Central POM for uber jar (#1432)
## Summary - Fixes #1431. The uber jar's published 3.3.2 POM on Maven Central declares a compile dependency on `com.databricks:databricks-jdbc-core:3.3.2`, which is never published. Consumers bumping to 3.3.2 fail to resolve. - Switch `flatten-maven-plugin` for `assembly-uber` from `<dependencies>expand</dependencies>` to `<dependencies>remove</dependencies>`. The shaded uber jar bundles every runtime class, so the published POM should declare zero compile deps. - Adds a code comment explaining what `.flattened-pom.xml` is and why the dependencies must be stripped. ## Why `expand` was wrong `flatten-maven-plugin`'s `expand` rewrites direct + transitive deps into a flat list, but it doesn't strip a direct dependency that points at an unpublished sibling module. `databricks-jdbc-core` is built locally during the release workflow's `mvn install -pl jdbc-core -am` step but is intentionally not deployed to Maven Central. The 3.3.1 release happened to publish a POM with no `<dependencies>` section (via the prior release pipeline); 3.3.2 was the first release through the new `peco-databricks-jdbc.yml` workflow, and that workflow uploads `assembly-uber/.flattened-pom.xml` as the published POM — which still names `databricks-jdbc-core` as a compile dep. ## Test plan - [x] Reproduced the bug locally by running the release workflow's exact `mvn` invocations on `main` (v3.3.2 source) and confirming `assembly-uber/.flattened-pom.xml` had the broken `databricks-jdbc-core` dep. - [x] Reproduced the consumer-side failure: `mvn dependency:resolve` of `com.databricks:databricks-jdbc:3.3.2` against a local repo with `jdbc-core` removed fails with the same error reported in #1431. - [x] Verified the fix: with this patch applied, the rebuilt `.flattened-pom.xml` has no `<dependencies>` and no `<parent>`, byte-equivalent in shape to the published 3.3.1 POM. `mvn dependency:resolve` of `com.databricks:databricks-jdbc:3.3.2` against a local repo missing both `databricks-jdbc-core` and `databricks-jdbc-parent` succeeds. - [ ] Recovery: a follow-up release (3.3.3) is needed since 3.3.2 cannot be yanked from Maven Central. This patch is the source-side change required for that release. ## Companion change A workflow-side change is also needed in `databricks-eng/secure-public-registry-releases-eng` so the thin JAR's published POM is sourced from `dependency-reduced-pom.xml` instead of `.flattened-pom.xml`. The thin POM happened to publish correctly for 3.3.1 due to flatten-plugin behaviour but is structurally fragile in the same way — that PR is filed separately. NO_CHANGELOG=false OVERRIDE_FREEZE=true This pull request and its description were written by Isaac. Signed-off-by: Vikrant Puppala <vikrant.puppala@databricks.com>
1 parent d54693a commit 3a039b7

2 files changed

Lines changed: 13 additions & 1 deletion

File tree

NEXT_CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@
88

99
### Fixed
1010

11+
- Fix unresolvable Maven Central POM for the uber JAR. The published POM no longer
12+
declares a transitive dependency on the internal `databricks-jdbc-core` coordinate
13+
(which is not published to Maven Central), restoring resolution for downstream
14+
consumers (#1431).
15+
1116
---
1217
*Note: When making changes, please add your change under the appropriate section
1318
with a brief description.*

assembly-uber/pom.xml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,13 @@
6161

6262
<build>
6363
<plugins>
64+
<!-- flatten-maven-plugin produces .flattened-pom.xml: a self-contained
65+
POM with the parent reference inlined and all <dependencies> stripped.
66+
The shaded uber jar bundles every runtime dep, so the published POM
67+
must declare zero compile deps; otherwise consumers transitively pull
68+
the internal databricks-jdbc-core coordinate (which is not published
69+
to Maven Central) and resolution fails. The release workflow uploads
70+
.flattened-pom.xml as the published POM. -->
6471
<plugin>
6572
<groupId>org.codehaus.mojo</groupId>
6673
<artifactId>flatten-maven-plugin</artifactId>
@@ -69,7 +76,7 @@
6976
<updatePomFile>true</updatePomFile>
7077
<flattenMode>oss</flattenMode>
7178
<pomElements>
72-
<dependencies>expand</dependencies>
79+
<dependencies>remove</dependencies>
7380
<build>remove</build>
7481
</pomElements>
7582
</configuration>

0 commit comments

Comments
 (0)