-
Notifications
You must be signed in to change notification settings - Fork 254
README增加jackson兼容性解决方法 #126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
README.md
Outdated
@@ -359,6 +359,29 @@ dependencies { | |||
} | |||
``` | |||
|
|||
### 如何解决jackson兼容性问题 | |||
项目使用的jackson版本为`2.12.5`,同时引入该项目和版本低于`2.5.x`的SpringBoot会有jackson兼容性问题。推荐升级SpringBoot到版本`2.5.x`及以上。如无法升级,可按照下述方式指定jackson版本。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- 具体原因应该讲得更清楚。首先是我们升级了jackson并使用了
2.11
中的API。但是,其他组件依赖了低版本,自动引入产生了冲突。 - 建议升级Springboot版本时,建议补充原因,别人才愿意升级嘛
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已修改
README.md
Outdated
@@ -359,6 +359,29 @@ dependencies { | |||
} | |||
``` | |||
|
|||
### 如何解决jackson兼容性问题 | |||
项目使用的jackson版本为`2.12.5`,同时引入该项目和版本低于`2.5.x`的SpringBoot会有jackson兼容性问题。推荐升级SpringBoot到版本`2.5.x`及以上。如无法升级,可按照下述方式指定jackson版本。 | |||
#### gradle |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
留意大小写
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gradle 的 G 也要大写,包括下面的 Maven
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已修改
README.md
Outdated
@@ -359,6 +359,28 @@ dependencies { | |||
} | |||
``` | |||
|
|||
### 如何解决jackson兼容性问题 | |||
项目升级了Jackson依赖,在代码中使用了版本高于`2.11`的API。当其他组件引用低版本的Jackson时会导致依赖冲突,例如版本低于`2.3.x`的SpringBoot。[官方已不再维护版本低于`2.3.x`的SpringBoot](https://spring.io/projects/spring-boot#support),推荐升级。如无法升级,可按照下述方式指定Jackson版本。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
建议使用 < <= > >=
来精确表达区间开闭,在点进去「官方已不再维护版本低于2.3.x
的SpringBoot」这个链接之前,我是不太确定「低于2.3.x
」是否包含2.3.x
的。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已修改
``` | ||
#### maven | ||
```xml | ||
<dependencyManagement> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
依赖填写的顺序是否需要说明下?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里是单独的dependencyManagement
依赖管理块,这个块里只需声明一个依赖,所以不用说明顺序。依赖管理块与单独的dependencies
是不相关的。
README.md
Outdated
@@ -359,6 +359,28 @@ dependencies { | |||
} | |||
``` | |||
|
|||
### 如何解决jackson兼容性问题 | |||
项目升级了Jackson依赖,在代码中使用了版本>=`2.11`的API。当其他组件引用低版本的Jackson时会导致依赖冲突,例如版本<`2.3.x`的SpringBoot。[官方已不再维护版本<`2.3.x`的SpringBoot](https://spring.io/projects/spring-boot#support),推荐升级。如无法升级,可按照下述方式指定Jackson版本。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这段话感觉很生硬,应该使用对话式的语态,就像跟开发者说话那样。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
因为项目升级了Jackson依赖,在代码中使用了版本>=2.11
的API,当其他组件引用低版本的Jackson时会导致依赖冲突。例如版本<2.3.x
的SpringBoot。由于官方已不再维护版本<2.3.x
的SpringBoot,继续使用有风险,推荐开发者及时升级。如果由于特殊原因无法升级,可以按照下面的方式指定Jackson版本。
这样是否可以?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No description provided.