Eclipse 3.7 (Indigo): How to add a remote Maven 2 repository mirror

I recently installed Eclipse 3.7 (Indigo) and now a wanted to start a new project using the integrated Maven plugins.

Problem is, I can't download any dependencies from the central maven 2 repository http://repo1.maven.org/maven2
After creating a new simple Maven project (without an archetype), i constantly get these Error messages:

  • Description Resource Path Location Type CoreException: Could not calculate build plan: Plugin org.apache.maven.plugins:maven-compiler-plugin:2.3.2 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-compiler-plugin:jar:2.3.2: ArtifactResolutionException: The repository system is offline but the artifact org.apache.maven.plugins:maven-compiler-plugin:pom:2.3.2 is not available in the local repository. pom.xml /JAVA line 1 Maven Project Build Lifecycle Mapping Problem
  • Description Resource Path Location Type Could not calculate build plan: Plugin org.apache.maven.plugins:maven-resources-plugin:2.4.3 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.4.3 pom.xml /JAVA line 1 Maven Build Problem
  • Description Resource Path Location Type Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (execution: default-compile, phase: compile) pom.xml /JAVA line 1 Maven Project Build Lifecycle Mapping Problem
  • Description Resource Path Location Type Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-compiler-plugin:2.3.2:testCompile (execution: default-testCompile, phase: test-compile) pom.xml /JAVA line 1 Maven Project Build Lifecycle Mapping Problem
  • Using an archetype doesn't work at all.

    Am I right to just add another repository mirror to get the needed dependencies?
    If so, how do I add another one?


    Update: I wrote a D:Users.m2settings.xml manually and the m2e-plugin recognized it correctly:

    <settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
                          http://maven.apache.org/xsd/settings-1.0.0.xsd">
      <localRepository/>
      <interactiveMode/>
      <usePluginRegistry/>
      <offline/>
      <pluginGroups/>
      <servers/>
        <mirrors>
            <mirror>
              <id>dotsrc.org</id>
              <url>http://mirrors.dotsrc.org/maven2</url>
              <mirrorOf>central</mirrorOf>
            </mirror>
        </mirrors>
      <proxies/>
      <profiles/>
      <activeProfiles/>
    </settings>
    

    Problem is: I can't find a complete mirror of the Maven central repository. I tried every single one I could find on the net, but all are missing some dependencies, archetypes, etc.

    Any help out there?


    尝试其中之一。

    链接地址: http://www.djcxy.com/p/87272.html

    上一篇: 创建一个Maven项目

    下一篇: Eclipse 3.7(Indigo):如何添加远程Maven 2存储库镜像