在pom.xml中更新Spring-boot版本时出错?

时间:2018-03-27 05:51:36

标签: spring maven spring-boot log4j parent-pom

我将spring-boot父版本从1.2.5更新为1.5.9。

<parent>
  <groupId>org.springframework.boot</groupId>
  <artifactId>spring-boot-starter-parent</artifactId>
  <version>1.5.9.RELEASE</version>
</parent>

更新版本后,spring-boot-starter-log4j会显示以下错误消息。

Project build error: 'dependencies.dependency.version' for org.springframework.boot:spring-boot-starter-log4j:jar is missing.

这是pom.xml中的spring-boot-starter-log4j依赖性。

<dependency>
  <groupId>org.springframework.boot</groupId>
  <artifactId>spring-boot-starter-log4j</artifactId>
</dependency>

帮我解决这个问题。

1 个答案:

答案 0 :(得分:2)

尝试使用log4j2

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-log4j2</artifactId>
</dependency>

要返回log4j,即log4j 1,您将需要进行一些自定义。