在我们公司中,我们使用的是本地关系存储库。如果现在尝试使用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

使用集成的构建或将安装作为“运行方式”任务运行,解决“正常” Artifact 的工作都很好。

在解决这个问题之前,我很简短。

欢迎所有想法。

提前Thx

杰伊·比(JayBee)

最佳答案

好吧,我到目前为止已经弄清楚了,看来m2eclipse使用的是.m2/settings.xml中指定的代理,但是如果放弃原型(prototype),它将忽略nonProxyHosts。

我向m2eclipse项目提交了错误报告:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=348893

谢谢。

关于eclipse - m2eclipse无法从关系解析原型(prototype),我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/6264863/

10-08 20:46