admin管理员组文章数量:1618728
报错内容:
Caused by: org.apache.maven.pluginpiler.CompilationFailureException: Compilation failure
error: cannot access NotThreadSafe
报错原因:
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.2</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcore</artifactId>
<version>4.4.5</version>
</dependency>
httpclient 和 httpcore 包的版本不匹配。
注意!网上很多帖子都说降低httpcore到4.4.4 就能解决问题,因为4.5.2和4.4.4匹配。
但是这里的httpclient包本身就是有安全漏洞的,容易被XSS攻击。
httpclient问题详见: https://github/advisories/GHSA-7r82-7xv7-xcpj
Apache HttpClient versions prior to version 4.5.13 and 5.0.3 can misinterpret malformed authority component in request URIs passed to the library as java.URI object and pick the wrong target host for request execution.
因此,这里可以将httpclient升级到4.5.13,与httpcore的4.4.5匹配。两全其美。
正确的引用姿势:
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.13</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcore</artifactId>
<version>4.4.5</version>
</dependency>
本文标签:
版权声明:本文标题:CompilationFailureException: Compilation failure error: cannot access NotThreadSafe 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://www.elefans.com/xitong/1728785341a1173253.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论