Skip to content

feat: adopt selective dependency packaging (profiles)#1228

Open
ramonskie wants to merge 3 commits intomainfrom
cached-profiles
Open

feat: adopt selective dependency packaging (profiles)#1228
ramonskie wants to merge 3 commits intomainfrom
cached-profiles

Conversation

@ramonskie
Copy link
Copy Markdown
Contributor

Summary

Wires the new selective dependency packaging feature into the java-buildpack, adopting the --profile, --exclude, and --include flags introduced in the libbuildpack packager.

Depends on: cloudfoundry/libbuildpack#212

Changes

  • manifest.yml — adds packaging_profiles section with two profiles:
    • minimal: JDKs, CF utilities, Tomcat, and common frameworks only (47 → 28 deps)
    • standard: core + open-source APM, OTel, and JDBC drivers (47 → 32 deps)
  • scripts/package.sh — parses and forwards --profile, --exclude, --include to buildpack-packager; updates usage()
  • README.md — documents selective offline packaging, updated --help output, and expanded package examples
  • docs/DEVELOPING.md — documents profile/exclude options in the packaging section
  • docs/buildpack-modes.md — adds "Selective Offline Packaging" subsection under Offline Mode

Usage examples

# Full offline build — unchanged behaviour
./scripts/package.sh --cached

# Air-gapped: JDKs + Tomcat only (~28 deps, significantly smaller zip)
./scripts/package.sh --cached --profile minimal

# Ops team: core + open-source observability (~32 deps)
./scripts/package.sh --cached --profile standard

# One-off: drop agents you don't have licences for
./scripts/package.sh --cached --exclude jrebel,your-kit-profiler,jprofiler-profiler

# Minimal profile, but restore jprofiler for a triage build
./scripts/package.sh --cached --profile minimal --include jprofiler-profiler

Notes

  • Fully backward compatible: ./scripts/package.sh --cached produces identical output to before.
  • --profile, --exclude, and --include are only valid with --cached (enforced by buildpack-packager).
  • --include requires --profile to be set (enforced by buildpack-packager).

Add packaging_profiles to manifest.yml and wire --profile/--exclude/--include
flags through scripts/package.sh to buildpack-packager.

Depends on libbuildpack PR cloudfoundry/libbuildpack#212 which introduces
PackageWithOptions, resolveExclusions, and the three new CLI flags in
buildpack-packager.

Changes:
- manifest.yml: add packaging_profiles section with 'minimal' (28 deps)
  and 'standard' (32 deps) profiles
- scripts/package.sh: parse and forward --profile, --exclude, --include
  to buildpack-packager; update usage()
- README.md: document selective offline packaging, updated --help output
  and package examples
- docs/DEVELOPING.md: document profile/exclude options in packaging section
- docs/buildpack-modes.md: add Selective Offline Packaging subsection
@ramonskie
Copy link
Copy Markdown
Contributor Author

once pr cloudfoundry/libbuildpack#212 is merged.
the CI will create a new pr in each buildpack to update the libbuildpack.

this merge is nesccary before the merge of this pr

Copy link
Copy Markdown
Contributor

@kiril-keranov kiril-keranov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Would be very useful

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.

2 participants