3

In the POM for my project I've put the following dependency:

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

And the following compiler plugin:

<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>

So I would expect that Maven downloads the 1.8.6 jar of Groovy, but instead it seems like it tries to download every jar ever published!

[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

What is causing this strange behavior?

Fylke
  • 1,753
  • 3
  • 19
  • 30

2 Answers2

2

See: 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> 

It needs all versions. Add

<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>

to your pom if you need snapshots.

Koray Tugay
  • 22,894
  • 45
  • 188
  • 319
Andrzej Jozwik
  • 14,331
  • 3
  • 59
  • 68
  • Umm, could you clarify that? Does it need all those versions to be able to compile any version of Groovy? I am only interested in the latest (1.8.6). Right now, due to it wanting to download all those dependencies, every build takes forever. – Fylke May 30 '12 at 00:53
  • By default maven want to download all missing dependencies. snapshots are downloaded during almost all builds (it checks if new version of snapshot is uploaded). If you need only 1.8.6 try to add section with groovy-eclipse-batch to your pom to maven-compiler-plugin dependencies section with your version. See [Maven automatic SNAPSHOT update](http://stackoverflow.com/q/2358965/651140) for range issue. – Andrzej Jozwik May 30 '12 at 06:46
0

I faced this same issue and resolved it with the following:

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