Skip to content

Only include dependencies in java maven-deps stages#2325

Closed
DMarby wants to merge 3 commits intomainfrom
dmarby/trim-pom-plugins
Closed

Only include dependencies in java maven-deps stages#2325
DMarby wants to merge 3 commits intomainfrom
dmarby/trim-pom-plugins

Conversation

@DMarby
Copy link
Member

@DMarby DMarby commented Mar 13, 2026

All the lifecycle plugins are part of our maven-jdk base image, so we want to exclude those. Regenerates the existing plugins.

DMarby added 3 commits March 13, 2026 18:49
All the lifecycle plugins are part of our maven-jdk base image, so we
exclude those by using dependency:copy-dependencies instead of go-offline.
This copies only declared dependencies and their transitive deps, cutting
repository size by 43% (133M -> 76M).

Changes:
- Switch from dependency:go-offline to dependency:copy-dependencies
- Remove <packaging>pom</packaging> (not needed with copy-dependencies)
- Remove <build><plugins> section (dead weight - compile service reads
  kotlin config from database, not from pom.xml)
- Add kotlin-maven-plugin as a <dependency> for copy-dependencies to fetch
- Add -Dmdep.copyPom=true to ensure POM files are copied alongside JARs
  (needed for Maven to resolve plugins from local file:// repository)
Maven needs parent POMs (protobuf-parent, protobuf-bom, etc.) to resolve
dependency descriptors from a local file:// repository. After
copy-dependencies populates /maven-repository with JARs and their POMs,
copy all .pom files from .m2/repository to pick up parent POM ancestry.
@DMarby DMarby closed this Mar 13, 2026
@DMarby DMarby deleted the dmarby/trim-pom-plugins branch March 13, 2026 18:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant