slachiewicz opened a new pull request, #1793:
URL: https://github.com/apache/maven-mvnd/pull/1793

   ## Problem
   
   Building mvnd 1.x with a modern JDK emits
   
   ```
   [WARNING] bootstrap class path not set in conjunction with -source 8
   [WARNING] source value 8 is obsolete and will be removed in a future release
   [WARNING] target value 8 is obsolete and will be removed in a future release
   [WARNING] ... com.sun.nio.file.SensitivityWatchEventModifier is internal 
proprietary API and may be removed in a future release
   [WARNING] ... com.sun.nio.file.SensitivityWatchEventModifier in 
com.sun.nio.file has been deprecated and marked for removal
   ```
   
   Because `maven.compiler.release` is deliberately undefined (`<!-- parent 
profile defines this; undefine -->`): `common/SignalHelper.java` uses 
`sun.misc.Signal` and `daemon/.../WatchServiceCacheFactory.java` uses 
`com.sun.nio.file.SensitivityWatchEventModifier` directly, and both are 
unreachable under `--release 8`.
   
   ## Change
   
   - Access `sun.misc.Signal.handle(...)` and 
`SensitivityWatchEventModifier.HIGH` reflectively, so neither the compilation 
nor the runtime hard-depends on internal API (both already degrade gracefully 
at runtime; now compilation no longer depends on it either).
   - Enable `<maven.compiler.release>8</maven.compiler.release>` in the parent 
and drop the per-module undefines in `common` and `daemon`; the 11-targeting 
modules (`build-plugin`, `dist`, `integration-tests`) get `release=11`, 
matching what `client` already does.
   - Fix the now-visible Java 9+ API usage in mvnd-common test sources 
(`Files.writeString`, `Stream.toList()`, `Process.onExit()`, `Path.of`), which 
compiled only because `-source 8` linked against the build JDK's bootclasspath.
   
   ## Verification
   
   - `mvn test -pl common -Dtest=DaemonRegistryTest` — 5/5 pass (covers the 
rewritten multi-process helpers)
   - `mvn test -pl daemon -Dtest=CacheFactoryTest` — 2/2 pass (exercises the 
reflective watch-modifier path)
   - `mvn spotless:check -pl common,daemon` — clean
   - No `obsolete`/`bootstrap class path` warnings during compilation anymore


-- 
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]

Reply via email to