我正在使用 Java11 构建我的项目,并且我的 pom 看起来像这样,我正在尝试为我的项目获取正确的 log4j-api
log4j-api 从 2.9 开始是一个多版本 jar,支持 java9+ 和更早的 java 版本
在我的项目中,我仍然无法 log4j-api-java9 https://github.com/apache/logging-log4j2/tree/master/log4j-api-java9
我的 pom 看起来像这样
...
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<vertx.version>3.5.3</vertx.version>
<log4j.version>2.11.1</log4j.version>
<async-http-client.version>2.5.2</async-http-client.version>
<maven.compiler.release>11</maven.compiler.release>
</properties>
<dependencies>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>${log4j.version}</version>
</dependency>
...
...
<dependencies>
<build>
...
<plugins>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.0</version>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<release>11</release>
</configuration>
<executions>
<execution>
<id>default-testCompile</id>
<phase>test-compile</phase>
<configuration>
<testExcludes>
<exclude>**/*IT.java</exclude>
</testExcludes>
</configuration>
<goals>
<goal>testCompile</goal>
</goals>
</execution>
</executions>
</plugin>
<plugins>
<build>
用这个也是没救了
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api-java9</artifactId>
<version>${log4j.version}</version>
</dependency>