maven:UnknownHostException:repo.maven.apache.org

时间:2014-12-03 09:57:33

标签: java apache maven

我遇到了这个问题:

  

[错误]插件org.apache.maven.plugins:maven-resources-plugin:2.6或其中一个依赖项无法解析:无法读取org.apache.maven.plugins的工件描述符:maven-resources-插件:jar:2.6:无法传输工件org.apache.maven.plugins:maven-resources-plugin:pom:2.6 from / to central(http://repo.maven.apache.org/maven2):repo.maven.apache.org:Unknown host repo .maven.apache.org - > [帮助1]   org.apache.maven.plugin.PluginResolutionException:插件org.apache.maven.plugins:maven-resources-plugin:2.6或其中一个依赖项无法解析:无法读取org.apache.maven.plugins的工件描述符: Maven的资源 - 插件:罐子:2.6       在org.apache.maven.plugin.internal.DefaultPluginDependenciesResolver.resolve(DefaultPluginDependenciesResolver.java:129)       在org.apache.maven.plugin.internal.DefaultMavenPluginManager.getPluginDescriptor(DefaultMavenPluginManager.java:142)       在org.apache.maven.plugin.internal.DefaultMavenPluginManager.getMojoDescriptor(DefaultMavenPluginManager.java:261)       在org.apache.maven.plugin.DefaultBuildPluginManager.getMojoDescriptor(DefaultBuildPluginManager.java:185)       在org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.setupMojoExecution(DefaultLifecycleExecutionPlanCalculator.java:152)       在org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.setupMojoExecutions(DefaultLifecycleExecutionPlanCalculator.java:139)       at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.calculateExecutionPlan(DefaultLifecycleExecutionPlanCalculator.java:116)       在org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.calculateExecutionPlan(DefaultLifecycleExecutionPlanCalculator.java:129)       在org.apache.maven.lifecycle.internal.BuilderCommon.resolveBuildPlan(BuilderCommon.java:92)       在org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)       在org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)       在org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)       在org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)       在org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)       在org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)       在org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)       在org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)       在org.apache.maven.cli.MavenCli.main(MavenCli.java:141)       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)       在java.lang.reflect.Method.invoke(Method.java:622)       在org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)       在org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)       在org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)       在org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)   引起:org.sonatype.aether.resolution.ArtifactDescriptorException:无法读取org.apache.maven.plugins的工件描述符:maven-resources-plugin:jar:2.6       at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom(DefaultArtifactDescriptorReader.java:296)       at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.readArtifactDescriptor(DefaultArtifactDescriptorReader.java:186)       at org.sonatype.aether.impl.internal.DefaultRepositorySystem.readArtifactDescriptor(DefaultRepositorySystem.java:279)       在org.apache.maven.plugin.internal.DefaultPluginDependenciesResolver.resolve(DefaultPluginDependenciesResolver.java:115)       ......还有25个   引起:org.sonatype.aether.resolution.ArtifactResolutionException:无法传输工件org.apache.maven.plugins:maven-resources-plugin:pom:2.6 from / to central(http://repo.maven.apache.org/maven2):repo.maven。 apache.org       at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:538)       at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:216)       at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolveArtifact(DefaultArtifactResolver.java:193)       at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom(DefaultArtifactDescriptorReader.java:281)       ......还有28个   引起:org.sonatype.aether.transfer.ArtifactTransferException:无法传输工件org.apache.maven.plugins:maven-resources-plugin:pom:2.6 from / to central(http://repo.maven.apache.org/maven2):repo.maven。 apache.org       at org.sonatype.aether.connector.wagon.WagonRepositoryConnector $ 4.wrap(WagonRepositoryConnector.java:951)       at org.sonatype.aether.connector.wagon.WagonRepositoryConnector $ 4.wrap(WagonRepositoryConnector.java:939)       at org.sonatype.aether.connector.wagon.WagonRepositoryConnector $ GetTask.run(WagonRepositoryConnector.java:669)       at org.sonatype.aether.util.concurrency.RunnableErrorForwarder $ 1.run(RunnableErrorForwarder.java:60)       在java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146)       at java.util.concurrent.ThreadPoolExecutor $ Worker.run(ThreadPoolExecutor.java:615)       在java.lang.Thread.run(Thread.java:701)   引起:org.apache.maven.wagon.TransferFailedException:repo.maven.apache.org       在org.apache.maven.wagon.shared.http.AbstractHttpClientWagon.fillInputData(AbstractHttpClientWagon.java:567)       在org.apache.maven.wagon.StreamWagon.getInputStream(StreamWagon.java:116)       在org.apache.maven.wagon.StreamWagon.getIfNewer(StreamWagon.java:88)       在org.apache.maven.wagon.StreamWagon.get(StreamWagon.java:61)       at org.sonatype.aether.connector.wagon.WagonRepositoryConnector $ GetTask.run(WagonRepositoryConnector.java:601)       ......还有4个   引起:java.net.UnknownHostException:repo.maven.apache.org       在java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:175)       在java.net.SocksSocketImpl.connect(SocksSocketImpl.java:385)       在java.net.Socket.connect(Socket.java:546)       在java.net.Socket.connect(Socket.java:495)       在java.net.Socket。(Socket.java:392)       在java.net.Socket。(Socket.java:266)       在org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:80)       在org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:122)       在org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:707)       在org.apache.commons.httpclient.MultiThreadedHttpConnectionManager $ HttpConnectionAdapter.open(MultiThreadedHttpConnectionManager.java:1361)       在org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:387)       在org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)       在org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)       在org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:323)       在org.apache.maven.wagon.shared.http.AbstractHttpClientWagon.execute(AbstractHttpClientWagon.java:446)       在org.apache.maven.wagon.shared.http.AbstractHttpClientWagon.fillInputData(AbstractHttpClientWagon.java:561)       ......还有8个

我确实有互联网连接。而且我不是代理人。

1 个答案:

答案 0 :(得分:2)

这是我的Internet提供商的错:他们的DNS服务器无法解析repo.maven.apache.org(我想杀死它们)。我切换到3g互联网连接,它工作,ping返回响应。