1

为什么 Maven Eclipse 插件会尝试下载文件名中带有双连字符的源 JAR?请参见下面的示例:在所有情况下,URL 的最后一位都应该是spring-web-3.0.5.RELEASE-sources.jar(一个连字符)而不是spring-web-3.0.5.RELEASE--sources.jar(两个连字符)。

我正在努力找出这是否是由于插件中的错误、Maven 元数据或其他原因造成的。

这是 Maven 运行的示例输出,当使用mvn eclipse:eclipse -DdownloadSources=true -DdownloadJavadocs=true -DforceRecheck=true

Downloading: http://artifactory.local:8081/artifactory/repo/org/springframework/spring-web/3.0.5.RELEASE/spring-web-3.0.5.RELEASE--sources.jar
[INFO] Unable to find resource 'org.springframework:spring-web:java-source:-sources:3.0.5.RELEASE' in repository central (http://artifactory.local:8081/artifactory/repo)
Downloading: http://repo1.maven.org/maven2/org/springframework/spring-web/3.0.5.RELEASE/spring-web-3.0.5.RELEASE--sources.jar
[INFO] Unable to find resource 'org.springframework:spring-web:java-source:-sources:3.0.5.RELEASE' in repository default (http://repo1.maven.org/maven2)
Downloading: http://maven.springframework.org/release/org/springframework/spring-web/3.0.5.RELEASE/spring-web-3.0.5.RELEASE--sources.jar
[INFO] Unable to find resource 'org.springframework:spring-web:java-source:-sources:3.0.5.RELEASE' in repository spring-maven-release (http://maven.springframework.org/release)
Downloading: http://maven.springframework.org/milestone/org/springframework/spring-web/3.0.5.RELEASE/spring-web-3.0.5.RELEASE--sources.jar
[INFO] Unable to find resource 'org.springframework:spring-web:java-source:-sources:3.0.5.RELEASE' in repository spring-maven-milestone (http://maven.springframework.org/milestone)
Downloading: http://spring-roo-repository.springsource.org/release/org/springframework/spring-web/3.0.5.RELEASE/spring-web-3.0.5.RELEASE--sources.jar
[INFO] Unable to find resource 'org.springframework:spring-web:java-source:-sources:3.0.5.RELEASE' in repository spring-roo-repository (http://spring-roo-repository.springsource.org/release)
Downloading: https://repository.jboss.org/nexus/content/repositories/releases/org/springframework/spring-web/3.0.5.RELEASE/spring-web-3.0.5.RELEASE--sources.jar
[INFO] Unable to find resource 'org.springframework:spring-web:java-source:-sources:3.0.5.RELEASE' in repository JBoss Repo (https://repository.jboss.org/nexus/content/repositories/releases)
Downloading: https://spring-roo-equals-roo-addon.googlecode.com/svn/maven-repository//org/springframework/spring-web/3.0.5.RELEASE/spring-web-3.0.5.RELEASE--sources.jar
[INFO] Unable to find resource 'org.springframework:spring-web:java-source:-sources:3.0.5.RELEASE' in repository googlecode.rooequals.repo (https://spring-roo-equals-roo-addon.googlecode.com/svn/maven-repository/)
Downloading: https://spring-roo-equals-roo-addon.googlecode.com/svn/maven-snapshot-repository//org/springframework/spring-web/3.0.5.RELEASE/spring-web-3.0.5.RELEASE--sources.jar
[INFO] Unable to find resource 'org.springframework:spring-web:java-source:-sources:3.0.5.RELEASE' in repository googlecode.rooequals.snapshotrepo (https://spring-roo-equals-roo-addon.googlecode.com/svn/maven-snapshot-repository/)

插件配置:

  <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-eclipse-plugin</artifactId>
    <version>2.9</version>  <!-- Note 2.8 does not work with AspectJ aspect path -->
    <configuration>
      <downloadSources>true</downloadSources>
      <downloadJavadocs>false</downloadJavadocs>
      <wtpversion>2.0</wtpversion>
      <additionalBuildcommands>
        <buildCommand>
          <name>org.eclipse.ajdt.core.ajbuilder</name>
          <arguments>
            <aspectPath>org.springframework.aspects</aspectPath>
          </arguments>
        </buildCommand>
        <buildCommand>
          <name>org.springframework.ide.eclipse.core.springbuilder</name>
        </buildCommand>
      </additionalBuildcommands>
      <additionalProjectnatures>
        <projectnature>org.eclipse.ajdt.ui.ajnature</projectnature>
        <projectnature>com.springsource.sts.roo.core.nature</projectnature>
        <projectnature>org.springframework.ide.eclipse.core.springnature</projectnature>
      </additionalProjectnatures>
    </configuration>
  </plugin>

更新 1

Maven版本是:

> mvn -version
Apache Maven 2.2.1 (r801777; 2009-08-06 20:16:01+0100)
Java version: 1.6.0_37
Java home: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
Default locale: en_US, platform encoding: MacRoman
OS name: "mac os x" version: "10.6.8" arch: "x86_64" Family: "mac"
4

0 回答 0