gnodet opened a new pull request, #12993: URL: https://github.com/apache/maven/pull/12993
## Summary - Add `NashornCompatibilityStrategy` to mvnup that detects `maven-antrun-plugin` JavaScript execution (`<script language="javascript">`) and injects `org.openjdk.nashorn:nashorn-core:15.4` as a plugin dependency - Searches build/plugins, build/pluginManagement/plugins, and profile builds for antrun JavaScript usage - Idempotent: skips injection if nashorn-core is already present as a plugin dependency - Includes 18 unit tests covering detection, injection, no-op scenarios, and the real Sling parent POM pattern Fixes #12988 ## Context Maven 4 requires JDK 17+, but Nashorn was removed in JDK 15. The 14 affected Apache Sling projects inherit from `org.apache.sling:sling:22` which executes inline JavaScript via `maven-antrun-plugin`. Toolchains don't help because the script runs in Maven's own JVM. The standalone OpenJDK Nashorn (`org.openjdk.nashorn:nashorn-core`) registers via `ServiceLoader` and provides a drop-in replacement. ## Test plan - [x] All 18 new unit tests pass (detection, injection, idempotency, profiles, pluginManagement, case-insensitive language, non-JS languages, existing dependencies, Sling BREE pattern) - [ ] CI build passes 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
