in our company we're using a local nexus repository. If I now try to create a new Maven project using the eclipse project wizard (M2Eclipse 0.12.1 installed) I allways get an 503 error from nexus.
在我们公司,我们使用的是本地的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
Resolving 'normal' artifacts works fine either using the integrated build or running install as "run-as" task.
使用集成的构建或作为“run-as”任务运行安装,可以很好地解决“正常”构件。
I'm short before going nuts on this problem.
在这个问题上我还没有发疯。
All ideas welcome.
欢迎所有的想法。
Thx in advance
谢谢提前
JayBee
JayBee
3 个解决方案
#1
5
Well I figured out so far that it seems, that m2eclipse is using the proxy specified in .m2/settings.xml but if relolving an archetype it ignores the nonProxyHosts.
到目前为止,我发现m2eclipse似乎使用了.m2/settings中指定的代理。但如果重新使用原型,则会忽略非proxyhosts。
I submitted a Bug-Report to the m2eclipse projekt: https://bugs.eclipse.org/bugs/show_bug.cgi?id=348893
我向m2eclipse projekt提交了一个bug报告:https://bugs.eclipse.org/bugs/show_bug.cgi?id=348893
Thx for the help.
谢谢的帮助。
#2
1
We (my team, that is) also get this issue. Command line Maven works like a charm, in Eclipse we get a red wall by Maven (we proxy all dependencies through our Nexus).
我们(我的团队)也遇到了这个问题。命令行Maven就像一个魔咒一样,在Eclipse中,Maven会给我们一个红色的墙(我们通过我们的Nexus代理所有依赖关系)。
I have however noticed, that once I set m2eclipse in Offline mode, it finds all dependencies. Since I often build in command line, resolving new dependencies this way is not an issue for me (it still might annoying for some).
但是我注意到,一旦我将m2eclipse设置为脱机模式,它就会找到所有依赖项。由于我经常在命令行中构建,所以以这种方式解析新依赖项对我来说不是问题(对一些人来说,这可能仍然很烦人)。
#3
0
Eclipse -> Window -> Preferences -> Maven
Eclipse ->窗口->首选项-> Maven
Uncheck the option - Do not automatically update dependencies from remote repositories.
取消选中该选项——不要自动更新来自远程存储库的依赖项。
This should take care of the problem.
这应该能解决问题。
#1
5
Well I figured out so far that it seems, that m2eclipse is using the proxy specified in .m2/settings.xml but if relolving an archetype it ignores the nonProxyHosts.
到目前为止,我发现m2eclipse似乎使用了.m2/settings中指定的代理。但如果重新使用原型,则会忽略非proxyhosts。
I submitted a Bug-Report to the m2eclipse projekt: https://bugs.eclipse.org/bugs/show_bug.cgi?id=348893
我向m2eclipse projekt提交了一个bug报告:https://bugs.eclipse.org/bugs/show_bug.cgi?id=348893
Thx for the help.
谢谢的帮助。
#2
1
We (my team, that is) also get this issue. Command line Maven works like a charm, in Eclipse we get a red wall by Maven (we proxy all dependencies through our Nexus).
我们(我的团队)也遇到了这个问题。命令行Maven就像一个魔咒一样,在Eclipse中,Maven会给我们一个红色的墙(我们通过我们的Nexus代理所有依赖关系)。
I have however noticed, that once I set m2eclipse in Offline mode, it finds all dependencies. Since I often build in command line, resolving new dependencies this way is not an issue for me (it still might annoying for some).
但是我注意到,一旦我将m2eclipse设置为脱机模式,它就会找到所有依赖项。由于我经常在命令行中构建,所以以这种方式解析新依赖项对我来说不是问题(对一些人来说,这可能仍然很烦人)。
#3
0
Eclipse -> Window -> Preferences -> Maven
Eclipse ->窗口->首选项-> Maven
Uncheck the option - Do not automatically update dependencies from remote repositories.
取消选中该选项——不要自动更新来自远程存储库的依赖项。
This should take care of the problem.
这应该能解决问题。