zqr10159 opened a new pull request, #4057: URL: https://github.com/apache/hertzbeat/pull/4057
This pull request upgrades the Java version used throughout the project from Java 17 to Java 21, and updates related documentation and dependencies. It also refactors code to use the new `jakarta.*` annotation packages and updates Jackson imports to use the `tools.jackson` namespace. Additionally, there are some dependency cleanups and improvements in alert notification handler implementations. **Java Version Upgrade:** - Upgraded the Java version from 17 to 21 in the build configuration (`pom.xml`), Dockerfile, and all related documentation files (`README.md`, `README_CN.md`, `README_JP.md`, `CONTRIBUTING.md`). [[1]](diffhunk://#diff-f599babd7e92e2d84200f41bfeeb52d0661ff2d888fd9669fc313e74595d3ee4L30-R30) [[2]](diffhunk://#diff-454eff0561fdbb1cdf08bef7a76ddf0f82c65fca08a150c43650f5098ecf7118L6-R7) [[3]](diffhunk://#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5L159-R159) [[4]](diffhunk://#diff-e6db595f1598cdd1968f25675bddebde43afe7e5a39e0aade96034d51c072ee7L156-R156) [[5]](diffhunk://#diff-3629b3e65246c37e96658c8e152222668d9313279ba005aee3f37b2c2afeef25L159-R159) [[6]](diffhunk://#diff-eca12c0a30e25b4b46522ebf89465a03ba72a03f540796c979137931d8f92055L35-R35) [[7]](diffhunk://#diff-eca12c0a30e25b4b46522ebf89465a03ba72a03f540796c979137931d8f92055L175-R175) **Dependency and Import Refactoring:** - Updated code to use `jakarta.annotation` instead of `javax.annotation` for annotations such as `@PostConstruct` and `@PreDestroy` in multiple files. [[1]](diffhunk://#diff-2a6d0fcc6a2fecc71708619a7ec13a90f8989d8eee0a020281b4a63dfeed541fL44-R44) [[2]](diffhunk://#diff-b237c80f3ebae611f4a53f11c353dadfabc41892b061e5df30c6126ee4e2523dL29-R29) [[3]](diffhunk://#diff-64b999a3852a13449a9e83b90333498b44c1344456e517681f5c536794e182adR21-R22) [[4]](diffhunk://#diff-64b999a3852a13449a9e83b90333498b44c1344456e517681f5c536794e182adL31-L32) [[5]](diffhunk://#diff-04649aec54b67b89c90ff127112acb43236b1b31fe315e5f2ecfba551e1c0603R22-R29) [[6]](diffhunk://#diff-0d5f8217133c05350c6056c00d898fdae73430755ab4ee22df0b7eec3969fea1R21-R29) - Changed Jackson imports from `com.fasterxml.jackson` to `tools.jackson` in several files, and removed the direct dependency on `jackson-dataformat-yaml` in `hertzbeat-ai/pom.xml`. [[1]](diffhunk://#diff-77f0068509309d508779f4c60006fd1eb72874a695663707188c681b8d62912cL20-R20) [[2]](diffhunk://#diff-77f0068509309d508779f4c60006fd1eb72874a695663707188c681b8d62912cR30) [[3]](diffhunk://#diff-0a28eb441105aab0530fea52579ca13fddd795e5b26e020d7fc9209c4ca2b6d5L20-R22) [[4]](diffhunk://#diff-de7f8a02db8328e659afb8b16ac84f6e0a36014bb20d5107561545296dd3dcd5L20-R21) [[5]](diffhunk://#diff-de7f8a02db8328e659afb8b16ac84f6e0a36014bb20d5107561545296dd3dcd5R33) [[6]](diffhunk://#diff-f599babd7e92e2d84200f41bfeeb52d0661ff2d888fd9669fc313e74595d3ee4L81-R81) [[7]](diffhunk://#diff-9e1d0fd4b5fe01841fcac7c471038b67af272a9323400ba9f3dff4deffca8278L21-L23) [[8]](diffhunk://#diff-9e1d0fd4b5fe01841fcac7c471038b67af272a9323400ba9f3dff4deffca8278R49) **Alert Notification Handler Improvements:** - Refactored `EmailAlertNotifyHandlerImpl` to remove Lombok's `@RequiredArgsConstructor`, use `JsonUtil` for JSON parsing, and added an explicit constructor for dependency injection. [[1]](diffhunk://#diff-8c14a41126af13a291f999bdbe9119de66b917f7e4d63eec089548cb271af313L20-L25) [[2]](diffhunk://#diff-8c14a41126af13a291f999bdbe9119de66b917f7e4d63eec089548cb271af313R32) [[3]](diffhunk://#diff-8c14a41126af13a291f999bdbe9119de66b917f7e4d63eec089548cb271af313L47) [[4]](diffhunk://#diff-8c14a41126af13a291f999bdbe9119de66b917f7e4d63eec089548cb271af313L73-R79) [[5]](diffhunk://#diff-8c14a41126af13a291f999bdbe9119de66b917f7e4d63eec089548cb271af313L91-R93) - Simplified `FeiShuAppAlertNotifyHandlerImpl` by removing unused `ObjectMapper` and related exceptions, and updated to use `tools.jackson.databind.JsonNode`. [[1]](diffhunk://#diff-9e1d0fd4b5fe01841fcac7c471038b67af272a9323400ba9f3dff4deffca8278L21-L23) [[2]](diffhunk://#diff-9e1d0fd4b5fe01841fcac7c471038b67af272a9323400ba9f3dff4deffca8278R49) [[3]](diffhunk://#diff-9e1d0fd4b5fe01841fcac7c471038b67af272a9323400ba9f3dff4deffca8278L81) [[4]](diffhunk://#diff-9e1d0fd4b5fe01841fcac7c471038b67af272a9323400ba9f3dff4deffca8278L137-R134) [[5]](diffhunk://#diff-9e1d0fd4b5fe01841fcac7c471038b67af272a9323400ba9f3dff4deffca8278L249-R246) **Dependency Management:** - Added `hertzbeat-common-core` as a provided dependency in `hertzbeat-alerter/pom.xml`. These changes modernize the codebase, ensure compatibility with newer Java versions, and improve maintainability by updating dependencies and simplifying 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
