为什么Maven想下载_all_版本的Groovy?

时间:2012-05-29 09:28:56

标签: maven groovy

在我的项目的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下载1.8.6格式的Groovy,但它似乎试图下载每个 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

造成这种奇怪行为的原因是什么?

2 个答案:

答案 0 :(得分: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。

答案 1 :(得分:0)

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

<repository>
  <id>Codehaus.Snapshots</id>
  <url>http://snapshots.repository.codehaus.org</url>
  <snapshots>
    <updatePolicy>never</updatePolicy>
    <enabled>false</enabled>
  </snapshots>
</repository>