2014-12-03 39 views
0

我有這個問題行家:行家:的UnknownHostException:repo.maven.apache.org

[ERROR]插件org.apache.maven.plugins:行家資源-插件:2.6或之一其無法解決依賴關係:無法讀取org.apache.maven.plugins的工件描述符:maven-resources-plugin: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:未知主機repo.maven.apache.org - > [Help 1] org.apache.maven.plugin.PluginResolutionException:插件org.apache.maven。插件:maven-resources-plugin:2.6或其某個依賴項無法解析:無法讀取工件描述符for org.apache.maven.plugins:maven-resources-plugin:jar:2.6 at org.apache.maven.plugin.internal.DefaultPluginDependenciesResolver.resolve(DefaultPluginDependenciesResolver.java:129) at 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(DefaultLifecycleExecutionPlanCalcul ator.java:139) 在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) at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183) at org.apache.maven.lifecycle.internal。大號ifecycleStarter.execute(LifecycleStarter.java:161) 在org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320) 在org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156) 在有機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) 在sun.reflect.NativeMethodAccessorImpl.invoke0(本機方法) 在sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) 在sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43 ) at java.lang.reflect.Method.invoke(Method.java:622) at org.codehaus.plexus.class world.launcher.Launcher.launchEnhanced(Launcher.java:290) at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230) at org.codehaus.plexus.classworlds.launcher.Launcher。 mainWithExitCode(Launcher.java:409) at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352) 原因:org.sonatype.aether.resolution.ArtifactDescriptorException:無法讀取工件描述符for 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) at 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.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.sonatype.aether.transfer.ArtifactTransferException:無法傳輸工件org.apache.maven。org.sonatype.aether.transfer.ArtifactTransferException:無法傳輸工件org.apache.maven。org.sonatype.aether.transfer.ArtifactTransferException:無法傳輸工件org.apache.maven。插件: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) 在org.sonatype.aether.connector.wagon.WagonRepositoryConnector $ 4.wrap(WagonRepositoryConnector.java:939) 在org.sonatype.aether.connector.wagon.WagonRepositoryConnector $ GetTask.run(WagonRepositoryConnector.java:669) 的組織。 sonatype.aether.util.concurrency.RunnableErrorForwarder $ 1.run(RunnableErrorForwarder.java:60) 在java.util.concurrent.ThreadPoolExecutor $ Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread。 java:701) 引起:org.apache.maven.wagon.TransferFailedException:repo.maven.apache.org at org.apache.maven.wagon.shared.http.AbstractHttpClientWagon.fillInputData(AbstractHttpClientWagon.java:567) at org.apache.maven.wagon.StreamWagon.getInputStream(StreamWagon.java:116) 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 $ GetTask.run(WagonRepositoryConnector.java:601) ... 4更多 原因:java.net.UnknownHostException:repo.maven.apache.org at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:175) at java.net.SocksSocketImpl.connect(SocksSocketImpl .java:385) at java.net.Socket.connect(Socket.java:546) at java.net.Socket.connect(Socket.java:495) at java.net.Socket。(Socket.java: 392) at java.net.Socket。(Socket.java:266) at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:80) at org.apache.commons.httpclient.protocol .DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:122) at org.apache.commons.httpc lient.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) at org.apache.maven.wagon.shared.http.AbstractHttpClientWagon.execute(AbstractHttpClientWagon.java:446) at org.apache.maven.wagon.shared。 http.AbstractHttpClientWagon.fillInputData(AbstractHttpClientWagon。java:561) ... 8更多

我的確有互聯網連接。而我並不是在代理之後。

+0

您確定groupid,artifact id和版本都正確嗎?您是否使用http://mvnrepository.com/來複制和粘貼依賴項? – 2014-12-03 10:10:56

+0

你能從命令行ping主機嗎? – crowne 2014-12-03 10:12:41

+0

ping repo.maven.apache.org給了我「未知的主機repo.maven.apache.org」,但我確信我有一個互聯網連接,否則我不能寫這個評論。 – zizoujab 2014-12-03 10:19:12

回答

2

這是我的互聯網提供商的錯:他們的DNS服務器無法解決repo.maven.apache.org(我想殺了他們)。我切換到3G互聯網連接,它的工作和平回返響應。