xuxiaowei-com-cn opened a new pull request, #8179:
URL: https://github.com/apache/incubator-seata/pull/8179
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!-- Please make sure you have read and understood the contributing
guidelines -->
- [ ] I have read the
[CONTRIBUTING.md](https://github.com/apache/incubator-seata/blob/2.x/CONTRIBUTING.md)
guidelines.
- [ ] I have registered the PR
[changes](https://github.com/apache/incubator-seata/tree/2.x/changes).
### Ⅰ. Describe what this PR did
Fix the `console` module compilation error caused by
`java.net.http.HttpClient` requiring Java 11+ while the module inherited Java
1.8 compiler settings from the parent POM.
**Changes:**
In `console/pom.xml`, add Java version properties under `<properties>`:
```xml
<java.version>17</java.version>
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
```
This overrides the inherited `<java.version>1.8</java.version>` from
`org.apache.seata:seata-build`, ensuring the `console` module compiles with
Java 17, which is consistent with the Spring Boot 4.0.6 and Spring Framework
7.0.7 baseline already used by the console module.
### Ⅱ. Does this pull request fix one issue?
<!-- If that, add "fixes #xxx" below in the next line, for example, fixes
#97. -->
fixes https://github.com/apache/incubator-seata/issues/8178
### Ⅲ. Why don't you add test cases (unit test/integration test)?
This is a build configuration change only (Maven compiler properties). The
existing test suite covers the runtime behavior. No new test cases are needed
for compile-level configuration adjustments.
### Ⅳ. Describe how to verify it
1. Import the project in IntelliJ IDEA.
2. Open the `console` module — confirm that `java.net.http.HttpClient`
usages no longer show compilation errors.
3. Run `mvn compile -pl console` — the build should succeed without errors.
### Ⅴ. Special notes for reviews
- `java.net.http.HttpClient` was introduced in Java 11, so the
`<java.version>` must be ≥ 11.
- Java 17 is chosen to align with Spring Boot 4.0.6 / Spring Framework 7.0.7
(which require Java 17+).
- The `console` module already specifies
`spring-boot-for-server.version=4.0.6` and
`spring-framework-for-server.version=7.0.7`, confirming Java 17 is the correct
baseline.
--
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]