Skip to content

Issue #15761 - Rework ${jetty.home}/lib/ for isolated environment libs, and introduce jetty-core-home archive. - #15762

Merged
joakime merged 1 commit into
jetty-12.1.xfrom
fix/12.1.x/jetty-home-lib-location-overhaul
Oct 24, 2026
Merged

joakime merged 1 commit into
jetty-12.1.xfrom
fix/12.1.x/jetty-home-lib-location-overhaul

Conversation

@joakime

@joakime joakime commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Reworked the ${jetty.home}/lib/ tree for the following ...

  1. ${jetty.home}/lib/<envname>/ - All environment specific libs go here.
  2. ${jetty.home}/lib/<envname>/support/ - All support libs (not made by Jetty) go here.

This allows users that do not need a specific environment's libs to delete them easily.
This makes cleanup for auditing tools easier. (Are you only using ee11, and you don't want your audit tools to scan the ee8 libs? Then just rm -rf $JETTY_HOME/lib/ee8)

Introduced new jetty-core-home which is an environment free version of jetty-home.
This is a standalone jetty-home that will work without an environment.
Suitable for ...

  • users that don't use the various jetty environments.
  • users that only use jetty core features.
  • users that want to composite a jetty-home with the existing jetty-ee#-home archives.
    Just like the above work, libs that are not created by Jetty go into a ${jetty.home}/lib/support/ directory.

The existing jetty-ee#-home archives are standalone, meaning that all files needed by jetty-home (xml, libs, modules, etc) are self contained within that jetty-ee#-home archive, and do not pollute the jetty-core-home archive anymore.

Removed duplicate jars in the ${jetty.home}/lib/ tree (see asm jars, and eclipse jdt ecj jars)

Introduced a new start.jar --validate-modules[=name] to validate the module file contents during build/test time, this catches a lot of common mistakes.
Introduced new DistributionTests.testValidateModules to fail the build if a module is detected as invalid (so that we don't continue to ship bad module files)

@joakime
joakime requested a review from olamy September 9, 2026 18:18
@joakime joakime self-assigned this Sep 9, 2026
@joakime joakime linked an issue Sep 9, 2026 that may be closed by this pull request
@joakime joakime changed the title Issue #15761 - Rework ${jetty.home}/lib/ for isolated environment libs, and introduce jetty-core-home. Issue #15761 - Rework ${jetty.home}/lib/ for isolated environment libs, and introduce jetty-core-home archive. Sep 9, 2026
@joakime
joakime marked this pull request as ready for review September 21, 2026 12:10
@joakime joakime added the Sponsored This issue affects a user with a commercial support agreement label Sep 21, 2026
@joakime joakime moved this to 👀 In review in Jetty 12.1.14 FROZEN Sep 21, 2026
@joakime joakime moved this to 🏗 In progress in Jetty 12.1.15 - FROZEN Sep 28, 2026
@joakime
joakime force-pushed the fix/12.1.x/jetty-home-lib-location-overhaul branch from af7a37e to d3b61a8 Compare October 14, 2026 10:46

@sbordet sbordet left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

A few things to fix provided as a separate document.

@joakime
joakime requested a review from sbordet October 15, 2026 19:20
@joakime

joakime commented Oct 15, 2026

Copy link
Copy Markdown
Contributor Author

@sbordet I've worked through the issues you've identified.
The hardcoded versions suggestion is postponed, as I need to implement a fix for maven resource filtering via our jetty-modify-sources-maven-plugin later, that can be a different (future) PR.

…tion

Reorganize how the Jetty distributions are assembled so that each layer
owns its own modules, config, and libs, and fix a large set of [lib]
section mistakes across the bundled modules.

Home/module layout
- Introduce jetty-core-home as the owner of core base resources (etc,
  bin, logging modules, demo content, LICENSE/NOTICE/README), moved out
  of jetty-home.
- Move JAAS/security config and modules (jaas, security, demo-realm,
  demo-jaas, and their etc/demo.d resources) from jetty-server into
  jetty-security, where they belong.
- Move the ee8/ee9/ee10/ee11 ext, jsp, jstl, and demos modules out of
  jetty-home and into each corresponding jetty-ee#-home.
- Rework the asm/annotations modules and split asm into its own module.
- Drop the duplicate ecj lib into a single standalone ecj module,
  include it in jetty-core-home, and exclude jdt/ecj from the
  jetty-ee#-home assemblies.
- Include the jakarta.servlet.jsp.jstl lib in jetty-ee9-home.
- Remove the now-unused jetty-source-assembly.xml from all *-home
  modules and simplify the jetty-home and jetty-ee9-home builds.

Module file handling
- Fix incorrect [lib] section paths across the ee# and session-store
  modules so libs resolve from the correct home locations.
- Do not re-download files that are already provided by a home.

start.jar --validate-modules
- Add ModulesValidation and a --validate-modules command that resolves
  every module's [files] and [lib] references and reports failures.
- Correctly handle --validate-modules=foo for an unknown module name,
  reporting it as an error instead of silently validating nothing.
- Add tests: ModuleValidationTest, FilesWithPropertiesTest,
  UriFileInitializerTest, and DistributionTests.testValidateModules,
  which asserts validation actually ran over a non-zero module count.
@joakime
joakime force-pushed the fix/12.1.x/jetty-home-lib-location-overhaul branch from 187ff0d to f546e2c Compare October 24, 2026 14:15
@joakime
joakime merged commit d992d49 into jetty-12.1.x Oct 24, 2026
2 of 4 checks passed
@joakime
joakime deleted the fix/12.1.x/jetty-home-lib-location-overhaul branch October 24, 2026 14:15
@github-project-automation github-project-automation Bot moved this from 👀 In review to ✅ Done in Jetty 12.1.15 - FROZEN Oct 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Enhancement Sponsored This issue affects a user with a commercial support agreement

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

Rework jetty-home lib directory to isolate environment specific libs

3 participants