SLF4J:未找到所需的 log4j 版本,但在 pom 中
SLF4J: Required log4j version not found, but in pom
使用 Eclipse Aether,出现以下错误:
SLF4J:此版本的 SLF4J 需要 log4j 版本 1.2.12 或更高版本。另见 http://www.slf4j.org/codes.html#log4j_version
在我的 Maven 依赖树中,我显然有 log4j 1.2.14(最后一行):
de.continentale.spu:rrep-pjava-deployer:jar:1.0.0-SNAPSHOT
+- org.slf4j:slf4j-log4j12:jar:1.7.9:compile
| \- org.slf4j:slf4j-api:jar:1.7.9:compile
+- junit:junit:jar:4.11:test
| \- org.hamcrest:hamcrest-core:jar:1.3:test
+- org.eclipse.aether:aether-impl:jar:1.1.0:compile
| +- org.eclipse.aether:aether-api:jar:1.1.0:compile
| +- org.eclipse.aether:aether-spi:jar:1.1.0:compile
| \- org.eclipse.aether:aether-util:jar:1.1.0:compile
+- org.eclipse.aether:aether-connector-basic:jar:1.1.0:compile
+- org.eclipse.aether:aether-transport-file:jar:1.1.0:compile
+- org.eclipse.aether:aether-transport-http:jar:1.1.0:compile
| +- org.apache.httpcomponents:httpclient:jar:4.3.5:compile
| | +- org.apache.httpcomponents:httpcore:jar:4.3.2:compile
| | \- commons-codec:commons-codec:jar:1.6:compile
| \- org.slf4j:jcl-over-slf4j:jar:1.6.2:compile
+- org.apache.maven:maven-aether-provider:jar:3.3.3:compile
| +- org.apache.maven:maven-model:jar:3.3.3:compile
| +- org.apache.maven:maven-model-builder:jar:3.3.3:compile
| | +- org.codehaus.plexus:plexus-interpolation:jar:1.21:compile
| | +- org.apache.maven:maven-builder-support:jar:3.3.3:compile
| | \- com.google.guava:guava:jar:18.0:compile
| +- org.apache.maven:maven-repository-metadata:jar:3.3.3:compile
| +- org.codehaus.plexus:plexus-component-annotations:jar:1.5.5:compile
| \- org.codehaus.plexus:plexus-utils:jar:3.0.20:compile
+- de.continentale.spu:rrep-pjava-index:jar:0.0.1-SNAPSHOT:compile
| \- de.regnis.q.sequence:sequence-library:jar:1.0.2:compile
+- org.tmatesoft.svnkit:svnkit:jar:1.8.12:compile
| +- com.jcraft:jsch.agentproxy.svnkit-trilead-ssh2:jar:0.0.7:compile
| | \- com.jcraft:jsch.agentproxy.core:jar:0.0.7:compile
| +- com.trilead:trilead-ssh2:jar:1.0.0-build220:compile
| +- net.java.dev.jna:jna-platform:jar:4.1.0:compile
| +- net.java.dev.jna:jna:jar:4.1.0:compile
| \- com.jcraft:jsch.agentproxy.connector-factory:jar:0.0.7:compile
| +- com.jcraft:jsch.agentproxy.usocket-jna:jar:0.0.7:compile
| | \- net.java.dev.jna:platform:jar:3.4.0:compile
| +- com.jcraft:jsch.agentproxy.usocket-nc:jar:0.0.7:compile
| +- com.jcraft:jsch.agentproxy.sshagent:jar:0.0.7:compile
| \- com.jcraft:jsch.agentproxy.pageant:jar:0.0.7:compile
+- org.tmatesoft.sqljet:sqljet:jar:1.1.9:compile
| \- org.antlr:antlr-runtime:jar:3.4:compile
+- commons-io:commons-io:jar:2.4:compile
+- org.apache.commons:commons-lang3:jar:3.1:compile
\- log4j:log4j:jar:1.2.14:compile
我不清楚如何避免 SLF4J 错误。
编辑:
我正在使用 Eclipse aether 联系 Maven 存储库
private static RepositorySystem newRepositorySystem()
{
DefaultServiceLocator locator = MavenRepositorySystemUtils
.newServiceLocator();
locator.addService(RepositoryConnectorFactory.class,
BasicRepositoryConnectorFactory.class);
locator.addService(TransporterFactory.class, FileTransporterFactory.class);
locator.addService(TransporterFactory.class, HttpTransporterFactory.class);
RepositorySystem service = locator.getService(RepositorySystem.class);
return service;
}
RepositorySystem service = locator.getService(RepositorySystem.class);
行产生错误,因为它可能是联系 SLF4J 的第一个位置。
问题出在 Maven 的 Eclipse 工作区解决方案中。
显然,在不同项目的 .classpath
中引用的 jar 可以覆盖 m2e 依赖项解析中的 POM 值。
整理第二个项目后一切正常。
使用 Eclipse Aether,出现以下错误:
SLF4J:此版本的 SLF4J 需要 log4j 版本 1.2.12 或更高版本。另见 http://www.slf4j.org/codes.html#log4j_version
在我的 Maven 依赖树中,我显然有 log4j 1.2.14(最后一行):
de.continentale.spu:rrep-pjava-deployer:jar:1.0.0-SNAPSHOT
+- org.slf4j:slf4j-log4j12:jar:1.7.9:compile
| \- org.slf4j:slf4j-api:jar:1.7.9:compile
+- junit:junit:jar:4.11:test
| \- org.hamcrest:hamcrest-core:jar:1.3:test
+- org.eclipse.aether:aether-impl:jar:1.1.0:compile
| +- org.eclipse.aether:aether-api:jar:1.1.0:compile
| +- org.eclipse.aether:aether-spi:jar:1.1.0:compile
| \- org.eclipse.aether:aether-util:jar:1.1.0:compile
+- org.eclipse.aether:aether-connector-basic:jar:1.1.0:compile
+- org.eclipse.aether:aether-transport-file:jar:1.1.0:compile
+- org.eclipse.aether:aether-transport-http:jar:1.1.0:compile
| +- org.apache.httpcomponents:httpclient:jar:4.3.5:compile
| | +- org.apache.httpcomponents:httpcore:jar:4.3.2:compile
| | \- commons-codec:commons-codec:jar:1.6:compile
| \- org.slf4j:jcl-over-slf4j:jar:1.6.2:compile
+- org.apache.maven:maven-aether-provider:jar:3.3.3:compile
| +- org.apache.maven:maven-model:jar:3.3.3:compile
| +- org.apache.maven:maven-model-builder:jar:3.3.3:compile
| | +- org.codehaus.plexus:plexus-interpolation:jar:1.21:compile
| | +- org.apache.maven:maven-builder-support:jar:3.3.3:compile
| | \- com.google.guava:guava:jar:18.0:compile
| +- org.apache.maven:maven-repository-metadata:jar:3.3.3:compile
| +- org.codehaus.plexus:plexus-component-annotations:jar:1.5.5:compile
| \- org.codehaus.plexus:plexus-utils:jar:3.0.20:compile
+- de.continentale.spu:rrep-pjava-index:jar:0.0.1-SNAPSHOT:compile
| \- de.regnis.q.sequence:sequence-library:jar:1.0.2:compile
+- org.tmatesoft.svnkit:svnkit:jar:1.8.12:compile
| +- com.jcraft:jsch.agentproxy.svnkit-trilead-ssh2:jar:0.0.7:compile
| | \- com.jcraft:jsch.agentproxy.core:jar:0.0.7:compile
| +- com.trilead:trilead-ssh2:jar:1.0.0-build220:compile
| +- net.java.dev.jna:jna-platform:jar:4.1.0:compile
| +- net.java.dev.jna:jna:jar:4.1.0:compile
| \- com.jcraft:jsch.agentproxy.connector-factory:jar:0.0.7:compile
| +- com.jcraft:jsch.agentproxy.usocket-jna:jar:0.0.7:compile
| | \- net.java.dev.jna:platform:jar:3.4.0:compile
| +- com.jcraft:jsch.agentproxy.usocket-nc:jar:0.0.7:compile
| +- com.jcraft:jsch.agentproxy.sshagent:jar:0.0.7:compile
| \- com.jcraft:jsch.agentproxy.pageant:jar:0.0.7:compile
+- org.tmatesoft.sqljet:sqljet:jar:1.1.9:compile
| \- org.antlr:antlr-runtime:jar:3.4:compile
+- commons-io:commons-io:jar:2.4:compile
+- org.apache.commons:commons-lang3:jar:3.1:compile
\- log4j:log4j:jar:1.2.14:compile
我不清楚如何避免 SLF4J 错误。
编辑:
我正在使用 Eclipse aether 联系 Maven 存储库
private static RepositorySystem newRepositorySystem()
{
DefaultServiceLocator locator = MavenRepositorySystemUtils
.newServiceLocator();
locator.addService(RepositoryConnectorFactory.class,
BasicRepositoryConnectorFactory.class);
locator.addService(TransporterFactory.class, FileTransporterFactory.class);
locator.addService(TransporterFactory.class, HttpTransporterFactory.class);
RepositorySystem service = locator.getService(RepositorySystem.class);
return service;
}
RepositorySystem service = locator.getService(RepositorySystem.class);
行产生错误,因为它可能是联系 SLF4J 的第一个位置。
问题出在 Maven 的 Eclipse 工作区解决方案中。
显然,在不同项目的 .classpath
中引用的 jar 可以覆盖 m2e 依赖项解析中的 POM 值。
整理第二个项目后一切正常。