FELIX-6852 Clean up jetty12 pom: de-duplicate bundle instructions, enable baselining - #538
Merged
Merged
Conversation
…able baselining - De-duplicate the maven-bundle-plugin executions: the with-jetty-websockets and with-jakarta-websockets executions now declare only the instructions that differ from the primary bundle (Export-Package and Import-Package). All shared instructions are inherited from the plugin-level <instructions> via Maven's plugin/execution configuration merge, the same mechanism the light bundle already relied on. The generated MANIFEST.MF of all four artifacts (main, light, with-jetty-websockets, with-jakarta-websockets) is unchanged. - Re-enable bnd baselining (baseline.skip=false). Baseline analysis passes with 0 errors against the 2.0.4 release. - Extract the duplicated slf4j version into a <slf4j.version> property. - Document that felix.java.version 17 is the floor (Jetty 12.1) and that virtual threads additionally require Java 21 at runtime. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Non-behavioural code cleanups in the jetty12 bundle: - Parameterize the raw org.osgi.framework.ServiceFactory anonymous classes (and their ServiceRegistration parameters) as ServiceFactory<Object> in JettyService and JettyActivator, removing the raw-type compiler warnings. - Break up the ~220-line JettyService.initializeJetty() by extracting three self-contained helpers: createServer() (thread pool / Server construction), configureGzipHandler() (compression handler setup) and configureRequestLogs() (request-log tracker, OSGi log and file log wiring). Pure extraction; the generated MANIFEST.MF of all four bundle artifacts is unchanged. - Guard endpoint-property computation against connectors that are not ServerConnectors: a ConnectorFactory may contribute a non-ServerConnector, which previously caused getServerConnector() to throw and abort endpoint computation. Such connectors are now skipped instead. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Housekeeping for the
http/jetty12bundle across two commits. No functional/behavioural change; verified below.Commit 1 — pom cleanup
maven-bundle-pluginexecutions. Thewith-jetty-websocketsandwith-jakarta-websocketsexecutions each repeated ~90 lines of<instructions>identical to the primary bundle. They now declare only the two headers that actually differ (Export-Package,Import-Package); everything shared (Bundle-SymbolicName,Bundle-Version,X-Jetty-Version,Bundle-Activator,Private-Package,DynamicImport-Package,Provide-Capability,Require-Capability,Include-Resource,_removeheaders) is inherited from the plugin-level<instructions>via Maven's plugin/execution configuration merge — the same mechanism thelightbundle already relied on.baseline.skiptrue→false).<slf4j.version>property, and document thatfelix.java.version17 is the floor (Jetty 12.1) while virtual threads additionally require Java 21 at runtime.Commit 2 — JettyService / JettyActivator internals
ServiceFactoryanonymous classes (and theirServiceRegistrationparameters) asServiceFactory<Object>, removing the raw-type compiler warnings.JettyService.initializeJetty()by extracting three self-contained helpers:createServer()(thread pool /Serverconstruction),configureGzipHandler()(compression handler setup) andconfigureRequestLogs()(request-log tracker + OSGi log + file log wiring). Pure extraction.ServerConnectorconnectors. AConnectorFactorymay contribute a connector that is not aServerConnector, which previously madegetServerConnector()throw and abort endpoint-property computation. Such connectors are now skipped.Why
The four near-identical instruction blocks were a maintenance hazard — recent SNI / redirect-compliance / Jetty-version changes all had to be mirrored by hand across them. Re-enabling baselining adds a safety net against accidental semantic-version breaks in the exported API. The
initializeJetty()split and the raw-type fixes are readability/robustness cleanups.Verification
Since changes (1) and (5) affect generated code / build output, I diffed a clean build before and after:
MANIFEST.MFof all four artifacts (main,light,with-jetty-websockets,with-jakarta-websockets) is byte-identical to the pre-change build (ignoring only tool/timestamp headers) — the de-dup and the method extraction are provably manifest-neutral.Baseline analysis complete, 0 error(s), 16 warning(s), against the 2.0.4 release.Reviewer notes
maven-bundle-pluginis intentionally kept at 6.0.2 (6.1.0 is not yet released).🤖 Generated with Claude Code