Export to GitHub

spock - issue #290

spock-maven:0.7-groovy-2.0 has an invalid descriptor (and a workaround for this)


Posted on Dec 26, 2012 by Grumpy Bear

Steps to reproduce problem:

1.Include spock-maven:0.7-groovy-2.0 in your pom.xml Example: <plugin> <groupId>org.spockframework</groupId> <artifactId>spock-maven</artifactId> <version>0.7-groovy-2.0</version> <executions> <execution> <goals> <goal>find-specs</goal> </goals> </execution> </executions> </plugin>

  1. mvn clean results in: [ERROR] BUILD ERROR [INFO] ------------------------------------------------------------------------ [INFO] Internal error in the plugin manager getting plugin 'org.spockframework:spock-maven': Plugin 'org.spockframework:spock-maven:0.7-groovy-2.0' has an invalid descriptor: 1) Plugin's descriptor contains the wrong version: 0.7-groovy-2.0-SNAPSHOT [INFO] ------------------------------------------------------------------------

  2. The error lies in:

localhost [20:21:43] ~/.m2/repository/org/spockframework/spock-maven/0.7-groovy-2.0 $ jar xf spock-maven-0.7-groovy-2.0.jar localhost [20:24:09] ~/.m2/repository/org/spockframework/spock-maven/0.7-groovy-2.0 $ grep "SNAPSHOT" META-INF/maven/plugin.xml <version>0.7-groovy-2.0-SNAPSHOT</version> <version>0.7-groovy-2.0-SNAPSHOT</version>

What version of Spock and Groovy are you using? Groovy 2.0.5 and Spock 0.7-groovy-2.0

Workaround/Fix: I edited the "META-INF/maven/plugin.xml" inside spock-maven-0.7-groovy-2.0.jar and changed the versions to "0.7-groovy-2.0" instead of "0.7-groovy-2.0-SNAPSHOT". Maven goals are now working.

Comment #1

Posted on Jan 7, 2013 by Massive Rhino

Annoying, but thanks for mentioning.

Comment #2

Posted on Jan 7, 2013 by Grumpy Cat

You most likely don't need the plugin (unless you make use of its single feature).

In the next version, the plugin will be more useful, and will work with Maven 3.x.

Comment #3

Posted on Jan 7, 2013 by Grumpy Bear

Sounds good. It turns out that I have do to "find-specs" in my maven build via the spock-maven plugin. If I remove it, maven doesn't find or run my spock tests.

Thanks, Peter!

Comment #4

Posted on Jan 7, 2013 by Grumpy Bear

Some more information (I'm not using maven3):

[19:30:24] ~ $ mvn -version Apache Maven 2.2.1 (rdebian-8) Java version: 1.7.0_09 Java home: /usr/lib/jvm/java-7-openjdk-amd64/jre Default locale: en_IN, platform encoding: UTF-8 OS name: "linux" version: "3.2.0-35-generic" arch: "amd64" Family: "unix"

Comment #5

Posted on Jan 7, 2013 by Grumpy Cat

Without the plugin, you'll have to adhere to the Maven/Surefire conventions for test class names (*Test etc.), or reconfigure them (e.g. to *Spec). When using the plugin, you can have arbitrary class names.

Comment #6

Posted on Jan 7, 2013 by Grumpy Bear

Ah, thanks for pointing that out. In that case, I'll cheerfully continue to use the spock-maven plugin :)

Comment #7

Posted on Jan 25, 2013 by Grumpy Cat

Issue 295 has been merged into this issue.

Comment #8

Posted on Jan 25, 2013 by Grumpy Cat

Issue 295 has been merged into this issue.

Comment #9

Posted on Mar 21, 2013 by Grumpy Cat

Issue 303 has been merged into this issue.

Comment #10

Posted on May 17, 2013 by Grumpy Cat

Issue 312 has been merged into this issue.

Comment #11

Posted on Dec 28, 2013 by Swift Lion

Why is this issue marked as fixed? As far as I can tell the latest artifact still has the incorrect version in the plugin descriptor.

Browse Spock artifacts in Maven central: http://search.maven.org/#browse|15844207

The latest, as of today, is 0.7-groovy-2.0 Download the file, open it up and open META-INF/maven/plugin.xml and the version is still 0.7-groovy-2.0-SNAPSHOT

Is it "fixed" because there is a workaround?

Comment #12

Posted on Dec 28, 2013 by Grumpy Cat

It's fixed in the development version (1.0-SNAPSHOT), which is available from http://oss. sonatype.org/content/repositories/snapshots/.

Comment #13

Posted on May 28, 2014 by Grumpy Cat

Issue 365 has been merged into this issue.

Comment #14

Posted on Sep 16, 2014 by Helpful Wombat

How do I convert the directory back to the jar in the work around?

Status: Fixed

Labels:
Type-Defect Module-Maven Milestone-1.0