在我们公司,我们正在使用本地nexus存储库。如果我现在尝试使用eclipse项目向导(安装了M2Eclipse 0.12.1)创建一个新的Maven项目,我总是从nexus得到503错误。
org.eclipse.core.runtime.CoreException: Could not resolve artifact
at org.maven.ide.eclipse.internal.embedder.MavenImpl.resolve(MavenImpl.java:577)
at org.maven.ide.eclipse.internal.project.ProjectConfigurationManager.resolveArchetype(ProjectConfigurationManager.java:526)
at org.maven.ide.eclipse.internal.project.ProjectConfigurationManager.createArchetypeProject(ProjectConfigurationManager.java:437)
at org.maven.ide.eclipse.wizards.MavenProjectWizard$5.runInWorkspace(MavenProjectWizard.java:279)
at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Contains: Could not transfer artifact org.apache.maven.archetypes:maven-archetype-quickstart:pom:1.0-alpha-4 from/to nexus (http://vm-nexus-slx.heuboe.hbintern:8080/nexus/content/groups/public): Failed to transfer http://vm-nexus-slx.heuboe.hbintern:8080/nexus/content/groups/public/org/apache/maven/archetypes/maven-archetype-quickstart/1.0-alpha-4/maven-archetype-quickstart-1.0-alpha-4.pom. Error code 503, Service Unavailable
org.sonatype.aether.transfer.ArtifactTransferException: Could not transfer artifact org.apache.maven.archetypes:maven-archetype-quickstart:pom:1.0-alpha-4 from/to nexus (http://vm-nexus-slx.heuboe.hbintern:8080/nexus/content/groups/public): Failed to transfer http://vm-nexus-slx.heuboe.hbintern:8080/nexus/content/groups/public/org/apache/maven/archetypes/maven-archetype-quickstart/1.0-alpha-4/maven-archetype-quickstart-1.0-alpha-4.pom. Error code 503, Service Unavailable
at org.sonatype.aether.connector.async.AsyncRepositoryConnector$3.wrap(AsyncRepositoryConnector.java:1413)
at org.sonatype.aether.connector.async.AsyncRepositoryConnector$3.wrap(AsyncRepositoryConnector.java:1404)
at org.sonatype.aether.connector.async.AsyncRepositoryConnector$GetTask.flush(AsyncRepositoryConnector.java:895)
at org.sonatype.aether.connector.async.AsyncRepositoryConnector$GetTask.flush(AsyncRepositoryConnector.java:889)
at org.sonatype.aether.connector.async.AsyncRepositoryConnector.get(AsyncRepositoryConnector.java:276)
at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:438)
at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolveArtifact(DefaultArtifactResolver.java:214)
at org.sonatype.aether.impl.internal.DefaultRepositorySystem.resolveArtifact(DefaultRepositorySystem.java:296)
at org.maven.ide.eclipse.internal.embedder.MavenImpl.resolve(MavenImpl.java:555)
at org.maven.ide.eclipse.internal.project.ProjectConfigurationManager.resolveArchetype(ProjectConfigurationManager.java:526)
at org.maven.ide.eclipse.internal.project.ProjectConfigurationManager.createArchetypeProject(ProjectConfigurationManager.java:437)
at org.maven.ide.eclipse.wizards.MavenProjectWizard$5.runInWorkspace(MavenProjectWizard.java:279)
at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Caused by: org.sonatype.aether.connector.async.TransferException: Failed to transfer http://vm-nexus-slx.heuboe.hbintern:8080/nexus/content/groups/public/org/apache/maven/archetypes/maven-archetype-quickstart/1.0-alpha-4/maven-archetype-quickstart-1.0-alpha-4.pom. Error code 503, Service Unavailable
使用集成构建或运行安装作为“run-as”任务,解析'普通'工件可以正常工作。
在解决这个问题之前,我做空了。
欢迎所有想法。
提前谢谢
JayBee
答案 0 :(得分:5)
到目前为止,我发现似乎m2eclipse正在使用.m2 / settings.xml中指定的代理,但是如果重新解析一个原型,它会忽略nonProxyHosts。
我向m2eclipse projekt提交了一份Bug报告: https://bugs.eclipse.org/bugs/show_bug.cgi?id=348893
请求帮助。
答案 1 :(得分:1)
我们(我的团队,也就是)也遇到了这个问题。命令行Maven就像一个魅力,在Eclipse中我们得到了Maven的红色墙(我们通过Nexus代理所有依赖项)。
我注意到,一旦我在离线模式下设置m2eclipse,它就会找到所有依赖项。由于我经常在命令行中构建,因此以这种方式解析新的依赖关系对我来说不是问题(对某些人来说仍然可能很烦人)。
答案 2 :(得分:0)
Eclipse - >窗口 - >偏好 - > Maven
取消选中该选项 - 不要自动更新远程存储库中的依赖项。
这应该解决问题。