我将Eclipse版本更新为4.9.0
我的项目在Maven中使用了log4j库。
但是Maven构建会引发错误,从而阻止Eclipse项目浏览器中的Maven依赖关系。
请教我如何解决此问题。
谢谢。
[捕获屏幕] https://i.stack.imgur.com/8MjfC.jpg
我在pom.xml中使用了以下代码
<org.slf4j-version>1.7.5</org.slf4j-version>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
<version>${org.slf4j-version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>${org.slf4j-version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
<exclusions>
<exclusion>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
</exclusion>
<exclusion>
<groupId>javax.jms</groupId>
<artifactId>jms</artifactId>
</exclusion>
<exclusion>
<groupId>com.sun.jdmk</groupId>
<artifactId>jmxtools</artifactId>
</exclusion>
<exclusion>
<groupId>com.sun.jmx</groupId>
<artifactId>jmxri</artifactId>
</exclusion>
</exclusions>
<scope>runtime</scope>
</dependency>
答案 0 :(得分:0)
我将Eclipse版本移至Neon 4.6.3。
所以我将显示的块解析为log4j。
但在下面出现错误:
请解决此错误
谢谢您的答复。
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for com.joins::war:1.0.0-BUILD-SNAPSHOT
[WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: org.mybatis:mybatis:jar -> duplicate declaration of version 3.2.2 @ line 249, column 15
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO]
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ ---
[INFO] Deleting joongangClickCountDashboard\target
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 2 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ ---
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!
[INFO] Compiling 188 source files to D:\sean-workspace-neon\ClickCountDashboard\target\classes
[INFO] -------------------------------------------------------------
[WARNING] COMPILATION WARNING :
[INFO] -------------------------------------------------------------
[WARNING] ClickCountDashboard/src/main/java/com/joins/innovation/campaign/excel/InnovationCampaignDataExcelBuilder.java:[10,17] jxl.write.Font in jxl.write has been deprecated
[WARNING] ClickCountDashboard/src/main/java/com/joins//facebook/service/impl/FacebookServiceImpl.java:[56,104] unchecked cast
required: java.util.HashMap<java.lang.String,org.bson.Document>
found: java.lang.Object
[WARNING] ClickCountDashboard/src/main/java/com/joins//facebook/service/impl/FacebookServiceImpl.java:[57,130] unchecked cast
required: java.util.HashMap<java.lang.String,java.util.HashMap<java.lang.String,java.lang.Integer>>
found: java.lang.Object
[WARNING] ClickCountDashboard/src/main/java/com/joins//common/db/MongoDBConnectionManager.java:[199,17] found raw type: java.util.List
missing type arguments for generic class java.util.List<E>
[WARNING] ClickCountDashboard/src/main/java/com/joins//common/db/MongoDBConnectionManager.java:[201,126] unchecked method invocation: method aggregate in interface com.mongodb.client.MongoCollection is applied to given types
required: java.util.List<? extends org.bson.conversions.Bson>
我在下面的Maven中有设置
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<compilerArgument>-Xlint:all</compilerArgument>
<showWarnings>true</showWarnings>
<showDeprecation>true</showDeprecation>
</configuration>
</plugin>