Trying to use Spock via GMaven (Maven 3.1.1) with Groovy 2.3 support and I am having difficulty getting SNAPSHOT dependency. I seem to have same error even when I try to run Spock Example project that has similar dependency defined.
<dependency>
<groupId>org.spockframework</groupId>
<artifactId>spock-core</artifactId>
<version>1.0-groovy-2.3-SNAPSHOT</version>
<scope>test</scope>
</dependency>
I have the SNAPSHOT repository specified like the Spock Example does:
<repositories>
<!-- Only required if a snapshot version of Spock is used -->
<repository>
<id>spock-snapshots</id>
<url>http://oss.sonatype.org/content/repositories/snapshots/</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
But even when I run mvn clean test
for Spock Example I get:
ERROR] Failed to execute goal on project spock-example: Could not resolve dependencies for project org.spockframework:spock-example:jar:1.0-SNAPSHOT: Failure to find org.spockframework:spock-core:jar:1.0-groovy-2.3-SNAPSHOT in was cached in the local repository, resolution will not be reattempted until the update interval of nexus_sprn has elapsed or updates are forced -> [Help 1]
I succeed if I simply use 0.7-groovy-2.0 version but I want Groovy 2.3 since it appears @CompileStatic does not work properly for my project in Groovy 2.0.
EDIT:
Just notice a warning happening just before the build fails:
[WARNING] The POM for org.spockframework:spock-core:jar:1.0-groovy-2.3-SNAPSHOT is missing, no dependency information available
So based on Mr. Niederwiesser's comment I found that the settings.xml my current project requires uses a mirror that does not know about the Spock SNAPSHOT location. In addition to re-configuring my company's proxy setting I had to do the following in my global settings.xml
to make it not use the mirror.
<mirrors>
<mirror>
<id>nexus_sprn</id>
<mirrorOf>*,!nexus_public,!project-lib-dir,!spock-snapshots</mirrorOf>
<url>MIRROR_URL_REMOVED</url>
</mirror>
</mirrors>
...
<repository>
<id>spock-snapshots</id>
<url>http://oss.sonatype.org/content/repositories/snapshots/</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
Not sure proper etiquette here but I will leave this answer here for future unless the general consensus is it is unnecessary.