Maven springource repo

时间:2012-11-05 16:54:04

标签: java maven maven-3

我有一个maven的问题,一直在寻找springource repos,并且在repos不可用时耗费大量时间试图通过:

[WARNING] The repository url 'http://repository.springsource.com/maven/bundles/release' is invalid - Repository 'com.springsource.repository.bundles.release' will be blacklisted.
[WARNING] The repository url 'http://repository.springsource.com/maven/bundles/external' is invalid - Repository 'com.springsource.repository.bundles.external' will be blacklisted.

我的问题是,我不明白为什么这些回购被提取为:

  • 我不使用任何弹簧组件
  • 似乎没有任何依赖性arrtifact从这些repos中获取(与mvn站点的依赖列表一起使用)
  • 未在我的任何文件中宣布回购

我试图将回购列表列入我们的archiva,甚至在我的本地〜/ .m2 / settings.xml中,即使回购网站将它们显示为黑名单,错误仍然会弹出并消耗时间。

我的印象是这个repo是由依赖项插件获取的,因为这发生在以下日志消息之后的站点阶段:

[INFO] Generating "Dependencies" report    --- maven-project-info-reports-plugin:2.6

在回购错误之前,我还有一些以下错误:

...
[ERROR] Artifact: xerces:xml-apis:jar:2.11.0 has no file.
[ERROR] Artifact: xerces:xmlParserAPIs:jar:2.6.2 has no file.
[ERROR] Artifact: xml-apis:xml-apis:jar:1.3.02 has no file.
[ERROR] Artifact: xom:xom:jar:1.0 has no file.
...

热烈欢迎任何关于如何找到负责任(工件或插件)或摆脱这些错误的想法。

感谢您提供任何线索

PS:我正在使用maven 3.0.4和JDK 1.7.0_04。

1 个答案:

答案 0 :(得分:1)

尝试运行:

mvn help:effective-pom

您至少会看到以下内容:

  <repositories>
    <repository>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
      <id>central</id>
      <name>Maven Repository Switchboard</name>
      <url>http://repo1.maven.org/maven2</url>
    </repository>
  </repositories>

然后你可能也会看到springource repo。


您还可以使用maven-enforcer-plugin并且不需要存储库规则。

<plugins>
  <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-enforcer-plugin</artifactId>
    <version>1.1.1</version>
    <executions>
      <execution>
        <id>enforce-no-repositories</id>
        <goals>
          <goal>enforce</goal>
        </goals>
        <configuration>
          <rules>
            <requireNoRepositories>
              <message>Best Practice is to never define repositories in pom.xml (use a repository manager instead)</message>
            </requireNoRepositories>
          </rules>
        </configuration>
      </execution>
    </executions>
  </plugin>
</plugins>

它会针对找到的定义了<repository/>标记的依赖关系发出消息。