5

关于log4j漏洞修复解决方案及源码编译

 2 years ago
source link: https://www.cnblogs.com/chengpanpan/p/15685597.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

关于log4j漏洞修复解决方案及源码编译

最近log4j爆出重大漏洞,程序员要赶紧修复了!文末提供已经编译好的jar包。

建议最好修复到log4j-2.15.0-rc2版本,临时解决方案还是存在jndi漏洞。

打开log4j官网https://github.com/apache/logging-log4j2/releases/tag/log4j-2.15.0-rc2

 发现官方网站给的是源码,没有jar包怎么办,这下在阿里云仓库找了rc2版本结果发现也是不能用的,于是自己就开始编译源码。

一.编译环境:

  windows10

  maven3.2.5(笔者采用此版本,建议大家maven版本不要超过3.6)

  jdk8以及以上

  需要jdk9或者jdk11,我采用jdk11(一定要有,主要是解决log4j-api-java9编译报错问题)。

https://download.oracle.com/otn/java/jdk/11.0.13+10/bdde8881e2e3437baa70044f884d2d67/jdk-11.0.13_windows-x64_bin.zip

二.编辑toolchains.xml文件,注意该文件位置在.m2目录下。

在toolchains.xml添加如下红框中内容,jdkHome修改自己本地的路径。

<toolchain>
<type>jdk</type>
<provides>
<version>11</version>
<vendor>sun</vendor>
</provides>
<configuration>
<jdkHome>D:\jdk\jdk-11.0.13</jdkHome>
</configuration>
</toolchain>

 三.切到log4j-2.15.0-rc2目录下

 四.执行  mvn install -Dmaven.test.skip=true

 五.等待编译结果,install成功后依赖就在本地仓库

 六.最后分享一下log4j-2.15.0-rc2源码编译后的jar包链接:https://pan.baidu.com/s/1U5kqGZ-RKLSkmbDkOVGsIg,某度网盘分享给大家,提取码请大家在评论区回复。

      你们的赞是我前进的动力。谢谢


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK