【发布时间】:2022-01-04 02:47:19
【问题描述】:
您好,由于 log4j 版本 2.10 或更高版本中的漏洞问题,我们需要在我们的一个应用程序中删除上述 jar 文件。我在我的 pom.xml 中尝试过这个,但遇到了一些错误。我在构建 maven 项目方面没有太多经验:(
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.3.RELEASE</version>
<relativePath /> <!-- lookup parent from repository -->
</parent>
<name>assistant</name>
<description>Assistant</description>
<groupId>com.assistant</groupId>
<artifactId>assistant</artifactId>
<packaging>war</packaging>
<version>2.0.2</version>
<properties>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-solr</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.webjars</groupId>
<artifactId>bootstrap</artifactId>
<version>4.3.1</version>
</dependency>
<dependency>
<groupId>org.webjars</groupId>
<artifactId>jquery</artifactId>
<version>3.3.1</version>
</dependency>
<dependency>
<groupId>org.webjars</groupId>
<artifactId>font-awesome</artifactId>
<version>5.7.2</version>
</dependency>
<dependency>
<groupId>javax.el</groupId>
<artifactId>javax.el-api</artifactId>
<version>3.0.0</version>
</dependency>
<!-- WORDPRESS DEPENDENCIES START-->
<dependency>
<groupId>org.kamranzafar.spring.wpapi</groupId>
<artifactId>spring-wpapi-client</artifactId>
<version>0.1</version>
</dependency>
<!-- WORDPRESS DEPENDENCIES END -->
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<excludes>
<exclude>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</build>
</project>
这是标记中的错误
【问题讨论】:
-
您排除了 log4j:log4j,它是 Log4j 1.x,它不容易受到最近出现的 log4j 2.x 问题的影响(即
org.apache.logging.log4j:log4j-core和其他具有 groupId @ 的工件987654325@)
标签: java spring-boot maven log4j