Skip to content

Make the Servlet import optional in the OSGi bundle - #1193

Open
MoChiUaena wants to merge 1 commit into
jknack:masterfrom
MoChiUaena:codex/optional-servlet-osgi-import
Open

MoChiUaena wants to merge 1 commit into
jknack:masterfrom
MoChiUaena:codex/optional-servlet-osgi-import

Conversation

@MoChiUaena

Copy link
Copy Markdown
Contributor

The handlebars OSGi bundle currently requires jakarta.servlet [6.1,7) even when an application never uses ServletContextTemplateLoader. As a result, the bundle cannot resolve without Servlet or with Servlet 6.0 alone.

Mark only the jakarta.servlet import optional. Its version range and the other package imports stay the same. In an Equinox check using the built JAR, applications without Servlet and with Servlet 6.0 both resolved the bundle and rendered a template. With Servlet 6.1, the package was still wired and ServletContextTemplateLoader could be constructed.

Validation: full clean package on JDK 17 and 21; all 11 modules succeeded on both, with 1,176 tests per run (3 existing skips, no failures or errors). The OSGi resolver and rendering checks covered all three Servlet setups.

Fixes #1179.

Allow the Handlebars bundle to resolve without Servlet when applications do not use ServletContextTemplateLoader. Keep the existing Servlet version range and other package imports unchanged.

Fixes jknack#1179

Signed-off-by: dlwlrma <965810157@qq.com>

This branch has not been deployed

No deployments
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.

Make jakarta.servlet import optional for consumers not using ServletContextTemplateLoader

1 participant