0
[ERROR] Failed to execute goal on project slf4j-log4j12: Could not resolve dep
dencies for project org.slf4j:slf4j-log4j12:jar:1.6.7-SNAPSHOT: Failed to coll
t dependencies for [org.slf4j:slf4j-api:jar:1.6.7-SNAPSHOT (compile), log4j:lo
j:jar:1.2.17 (compile), junit:junit:jar:3.8.1 (test)]: Failed to read artifact
escriptor for log4j:log4j:jar:1.2.17: Could not transfer artifact log4j:log4j:
m:1.2.17 from/to central (http://repo.maven.apache.org/maven2): Connection to
tp://repo.maven.apache.org refused: Connection timed out: connect -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal
n project slf4j-log4j12: Could not resolve dependencies for project org.slf4j:
f4j-log4j12:jar:1.6.7-SNAPSHOT: Failed to collect dependencies for [org.slf4j:
f4j-api:jar:1.6.7-SNAPSHOT (compile), log4j:log4j:jar:1.2.17 (compile), junit:
nit:jar:3.8.1 (test)]
        at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.get
pendencies(LifecycleDependencyResolver.java:210)
        at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.res
veProjectDependencies(LifecycleDependencyResolver.java:117)
        at org.apache.maven.lifecycle.internal.MojoExecutor.ensureDependencies
eResolved(MojoExecutor.java:258)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecut
.java:201)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecut
.java:153)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecut
.java:145)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildPro
ct(LifecycleModuleBuilder.java:84)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildPro
ct(LifecycleModuleBuilder.java:59)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreaded
ild(LifecycleStarter.java:183)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(Lifecy
eStarter.java:161)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImp
java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcc
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(La
cher.java:290)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.j
a:230)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(
uncher.java:409)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.jav
352)
Caused by: org.apache.maven.project.DependencyResolutionException: Could not r
olve dependencies for project org.slf4j:slf4j-log4j12:jar:1.6.7-SNAPSHOT: Fail
 to collect dependencies for [org.slf4j:slf4j-api:jar:1.6.7-SNAPSHOT (compile)
log4j:log4j:jar:1.2.17 (compile), junit:junit:jar:3.8.1 (test)]
        at org.apache.maven.project.DefaultProjectDependenciesResolver.resolve
efaultProjectDependenciesResolver.java:158)
        at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.get
pendencies(LifecycleDependencyResolver.java:185)
        ... 22 more
Caused by: org.sonatype.aether.collection.DependencyCollectionException: Faile
to collect dependencies for [org.slf4j:slf4j-api:jar:1.6.7-SNAPSHOT (compile),
og4j:log4j:jar:1.2.17 (compile), junit:junit:jar:3.8.1 (test)]
        at org.sonatype.aether.impl.internal.DefaultDependencyCollector.collec
ependencies(DefaultDependencyCollector.java:258)
        at org.sonatype.aether.impl.internal.DefaultRepositorySystem.collectDe
ndencies(DefaultRepositorySystem.java:308)
        at org.apache.maven.project.DefaultProjectDependenciesResolver.resolve
efaultProjectDependenciesResolver.java:150)
        ... 23 more
Caused by: org.sonatype.aether.resolution.ArtifactDescriptorException: Failed
 read artifact descriptor for log4j:log4j:jar:1.2.17
        at org.apache.maven.repository.internal.DefaultArtifactDescriptorReade
loadPom(DefaultArtifactDescriptorReader.java:296)
        at org.apache.maven.repository.internal.DefaultArtifactDescriptorReade
readArtifactDescriptor(DefaultArtifactDescriptorReader.java:186)
        at org.sonatype.aether.impl.internal.DefaultDependencyCollector.proces
DefaultDependencyCollector.java:412)
        at org.sonatype.aether.impl.internal.DefaultDependencyCollector.collec
ependencies(DefaultDependencyCollector.java:240)
        ... 25 more
Caused by: org.sonatype.aether.resolution.ArtifactResolutionException: Could n
 transfer artifact log4j:log4j:pom:1.2.17 from/to central (http://repo.maven.a
che.org/maven2): Connection to http://repo.maven.apache.org refused
        at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolve(D
aultArtifactResolver.java:538)
        at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolveAr
facts(DefaultArtifactResolver.java:216)
        at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolveAr
fact(DefaultArtifactResolver.java:193)
        at org.apache.maven.repository.internal.DefaultArtifactDescriptorReade
loadPom(DefaultArtifactDescriptorReader.java:281)
        ... 28 more
Caused by: org.sonatype.aether.transfer.ArtifactTransferException: Could not t
nsfer artifact log4j:log4j:pom:1.2.17 from/to central (http://repo.maven.apach
org/maven2): Connection to http://repo.maven.apache.org refused
        at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$4.wrap
agonRepositoryConnector.java:951)
        at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$4.wrap
agonRepositoryConnector.java:941)
        at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$GetTas
run(WagonRepositoryConnector.java:669)
        at org.sonatype.aether.util.concurrency.RunnableErrorForwarder$1.run(R
nableErrorForwarder.java:60)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolEx
utor.java:886)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecut
.java:908)
        at java.lang.Thread.run(Thread.java:662)
Caused by: org.apache.maven.wagon.TransferFailedException: Connection to http:
repo.maven.apache.org refused
        at org.apache.maven.wagon.shared.http4.AbstractHttpClientWagon.fillInp
Data(AbstractHttpClientWagon.java:799)
        at org.apache.maven.wagon.StreamWagon.getInputStream(StreamWagon.java:
6)
        at org.apache.maven.wagon.StreamWagon.getIfNewer(StreamWagon.java:88)
        at org.apache.maven.wagon.StreamWagon.get(StreamWagon.java:61)
        at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$GetTas
run(WagonRepositoryConnector.java:601)
        ... 4 more
Caused by: org.apache.maven.wagon.providers.http.httpclient.conn.HttpHostConne
Exception: Connection to http://repo.maven.apache.org refused
        at org.apache.maven.wagon.providers.http.httpclient.impl.conn.DefaultC
entConnectionOperator.openConnection(DefaultClientConnectionOperator.java:158)
        at org.apache.maven.wagon.providers.http.httpclient.impl.conn.Abstract
olEntry.open(AbstractPoolEntry.java:149)
        at org.apache.maven.wagon.providers.http.httpclient.impl.conn.Abstract
oledConnAdapter.open(AbstractPooledConnAdapter.java:121)
        at org.apache.maven.wagon.providers.http.httpclient.impl.client.Defaul
equestDirector.tryConnect(DefaultRequestDirector.java:573)
        at org.apache.maven.wagon.providers.http.httpclient.impl.client.Defaul
equestDirector.execute(DefaultRequestDirector.java:425)
        at org.apache.maven.wagon.providers.http.httpclient.impl.client.Abstra
HttpClient.execute(AbstractHttpClient.java:820)
        at org.apache.maven.wagon.providers.http.httpclient.impl.client.Abstra
HttpClient.execute(AbstractHttpClient.java:754)
        at org.apache.maven.wagon.shared.http4.AbstractHttpClientWagon.execute
bstractHttpClientWagon.java:674)
        at org.apache.maven.wagon.shared.http4.AbstractHttpClientWagon.fillInp
Data(AbstractHttpClientWagon.java:793)
        ... 8 more
Caused by: java.net.ConnectException: Connection timed out: connect
        at java.net.PlainSocketImpl.socketConnect(Native Method)
        at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:351)
        at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:213)
        at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:200)
        at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
        at java.net.Socket.connect(Socket.java:529)
        at org.apache.maven.wagon.providers.http.httpclient.conn.scheme.PlainS
ketFactory.connectSocket(PlainSocketFactory.java:123)
        at org.apache.maven.wagon.providers.http.httpclient.impl.conn.DefaultC
entConnectionOperator.openConnection(DefaultClientConnectionOperator.java:148)
        ... 16 more
[ERROR]
[ERROR]
[ERROR] For more information about the errors and possible solutions, please r
d the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyRe
lutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the comma

[ERROR]   mvn <goals> -rf :slf4j-log4j12

コードを変更していません。私はそれを複製して、を使用してビルドしようとしていmvn -installます。このエラーが発生する理由は何ですか?

4

1 に答える 1

1

Maven や slf4j とは関係ありません。中央の Maven リポジトリにアクセスできないため、ネットワーク エラーです (repo.maven.apache.org への「接続がタイムアウトしました」)。リポジトリが (一時的に) ダウンしているか、ネットワークの問題 (プロキシが見つからないなど) が発生しています。

于 2012-10-26T05:52:06.157 に答える