Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

m2eclipse can't resolve archetypes from nexus

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.

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.

I'm short before going nuts on this problem.

All ideas welcome.

Thx in advance

JayBee

like image 328
JayBee Avatar asked Jun 07 '11 12:06

JayBee


People also ask

What archetype should I choose for Maven project?

If you want a web application, use maven-archetype-webapp, or if you want a simple application use maven-archetype-quickstart. They are useful because you will be able to expand them with no problem. Note that this is in the Eclipse plugin by default (at least it is today).


2 Answers

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.

I submitted a Bug-Report to the m2eclipse projekt: https://bugs.eclipse.org/bugs/show_bug.cgi?id=348893

Thx for the help.

like image 136
JayBee Avatar answered Sep 27 '22 23:09

JayBee


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).

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).

like image 33
tptak Avatar answered Sep 28 '22 00:09

tptak