Commit 9ade1aa
Fix Jackson 2.21 compatibility for MavenSettings ServerConfiguration parsing (#6605)
* Fix Jackson 2.21 compatibility for MavenSettings ServerConfiguration parsing
The issue was that Jackson 2.21 became stricter about matching constructor
parameter names with XML property names. The @JacksonXmlProperty(localName = "property")
annotation on the httpHeaders field made Jackson think the property name was "property",
but the Lombok-generated constructor had a parameter named "httpHeaders", causing a mismatch.
The fix:
- Use a no-args constructor (marked with @JsonCreator) for ServerConfiguration
- Add setters for deserialization
- Move Jackson XML annotations from fields to getters
- Add explicit @JsonCreator constructor with @JsonProperty annotations to HttpHeader
This avoids changing defaultUseWrapper globally, which would require many compensating
changes in RawPom and other classes.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Further minimize changes
* Minimize indentation
* Minimize changes and retain immutability
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>1 parent f60cfb5 commit 9ade1aa
File tree
2 files changed
+473
-459
lines changed- rewrite-maven/src
- main/java/org/openrewrite/maven
- test/java/org/openrewrite/maven
2 files changed
+473
-459
lines changedLines changed: 24 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| |||
445 | 446 | | |
446 | 447 | | |
447 | 448 | | |
448 | | - | |
449 | | - | |
450 | | - | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
451 | 452 | | |
452 | 453 | | |
453 | 454 | | |
454 | | - | |
455 | | - | |
456 | | - | |
457 | 455 | | |
458 | 456 | | |
459 | 457 | | |
| |||
462 | 460 | | |
463 | 461 | | |
464 | 462 | | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
465 | 483 | | |
466 | 484 | | |
467 | 485 | | |
| |||
0 commit comments