3

在我的项目的 POM 中,我放置了以下依赖项:

<dependency>
    <groupId>org.codehaus.groovy</groupId>
    <artifactId>groovy-all</artifactId>
    <version>1.8.6</version>
</dependency>

以及以下编译器插件:

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-compiler-plugin</artifactId>
    <version>2.4</version>
    <configuration>
        <compilerId>groovy-eclipse-compiler</compilerId>
        <verbose>true</verbose>
    </configuration>
    <dependencies>
        <dependency>
            <groupId>org.codehaus.groovy</groupId>
            <artifactId>groovy-eclipse-compiler</artifactId>
            <version>2.6.0-01</version>
        </dependency>
    </dependencies>
</plugin>

所以我希望 Maven 下载 Groovy 的 1.8.6 jar,但它似乎试图下载曾经发布的每个jar!

[WARNING] The POM for org.codehaus.groovy:groovy:jar:1.5.5-SNAPSHOT is missing, no dependency information available
[WARNING] The POM for org.codehaus.groovy:groovy:jar:1.5.6-SNAPSHOT is missing, no dependency information available
[WARNING] The POM for org.codehaus.groovy:groovy:jar:1.5.7-SNAPSHOT is missing, no dependency information available
[WARNING] The POM for org.codehaus.groovy:groovy:jar:1.6-beta-1-SNAPSHOT is missing, no dependency information available
[WARNING] The POM for org.codehaus.groovy:groovy:jar:1.6-beta-2-SNAPSHOT is missing, no dependency information available
[WARNING] The POM for org.codehaus.groovy:groovy:jar:1.6-RC-1-SNAPSHOT is missing, no dependency information available
[WARNING] The POM for org.codehaus.groovy:groovy:jar:1.6-RC-2-SNAPSHOT is missing, no dependency information available
[WARNING] The POM for org.codehaus.groovy:groovy:jar:1.6.1-SNAPSHOT is missing, no dependency information available
[WARNING] The POM for org.codehaus.groovy:groovy:jar:1.6.3-SNAPSHOT is missing, no dependency information available
[WARNING] The POM for org.codehaus.groovy:groovy:jar:1.6.5-SNAPSHOT is missing, no dependency information available
[WARNING] The POM for org.codehaus.groovy:groovy:jar:1.7-beta-1-SNAPSHOT is missing, no dependency information available
[WARNING] The POM for org.codehaus.groovy:groovy:jar:1.7-rc-2-SNAPSHOT is missing, no dependency information available

是什么导致了这种奇怪的行为?

4

2 回答 2

2

请参阅:groovy-eclipse-compiler-2.6.0-01.pom

<dependency>
    <groupId>org.codehaus.groovy</groupId>
    <artifactId>groovy-eclipse-batch</artifactId>
 <version>[1.7.10-02,1.7.10-99],[1.8.2-01,1.9.0)</version> 
</dependency> 

它需要所有版本。添加

<repository>
      <id>codehaus-snapshots</id>
      <name>Codehaus Snapshots</name>
      <url>http://nexus.codehaus.org/snapshots/</url>
      <releases>
        <enabled>false</enabled>
       </releases>
       <snapshots>
         <enabled>true</enabled>
      </snapshots>
</repository>

如果您需要快照,请发送到您的 pom。

于 2012-05-29T20:04:58.390 回答
0

我遇到了同样的问题并通过以下方式解决了它:

<repository>
  <id>Codehaus.Snapshots</id>
  <url>http://snapshots.repository.codehaus.org</url>
  <snapshots>
    <updatePolicy>never</updatePolicy>
    <enabled>false</enabled>
  </snapshots>
</repository>
于 2012-07-25T22:35:42.803 回答