为什么Maven Eclipse插件会尝试在文件名中下载带有双连字符的源JAR?请参阅下面的示例:在所有情况下,URL的最后一位应为spring-web-3.0.5.RELEASE-sources.jar
(一个连字符)而不是spring-web-3.0.5.RELEASE--sources.jar
(两个连字符)。
我很难发现这是由于插件中的错误,还是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"