Forgus / spock

Automatically exported from code.google.com/p/spock
0 stars 0 forks source link

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

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
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>

2. 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] ------------------------------------------------------------------------

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

Original issue reported on code.google.com by ambarsek...@gmail.com on 26 Dec 2012 at 3:04

GoogleCodeExporter commented 8 years ago
Annoying, but thanks for mentioning.

Original comment by marceloverdijk on 7 Jan 2013 at 1:02

GoogleCodeExporter commented 8 years ago
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.

Original comment by pnied...@gmail.com on 7 Jan 2013 at 1:18

GoogleCodeExporter commented 8 years ago
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!

Original comment by ambarsek...@gmail.com on 7 Jan 2013 at 1:59

GoogleCodeExporter commented 8 years ago
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"

Original comment by ambarsek...@gmail.com on 7 Jan 2013 at 2:00

GoogleCodeExporter commented 8 years ago
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.

Original comment by pnied...@gmail.com on 7 Jan 2013 at 2:07

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

Original comment by ambarsek...@gmail.com on 7 Jan 2013 at 2:11

GoogleCodeExporter commented 8 years ago
Issue 295 has been merged into this issue.

Original comment by pnied...@gmail.com on 25 Jan 2013 at 12:28

GoogleCodeExporter commented 8 years ago
Issue 295 has been merged into this issue.

Original comment by pnied...@gmail.com on 25 Jan 2013 at 12:29

GoogleCodeExporter commented 8 years ago
Issue 303 has been merged into this issue.

Original comment by pnied...@gmail.com on 21 Mar 2013 at 1:24

GoogleCodeExporter commented 8 years ago
Issue 312 has been merged into this issue.

Original comment by pnied...@gmail.com on 17 May 2013 at 3:30

GoogleCodeExporter commented 8 years ago
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 <version>0.7-groovy-2.0-SNAPSHOT</version>

Is it "fixed" because there is a workaround?

Original comment by n...@faceture.com on 28 Dec 2013 at 5:09

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

Original comment by pnied...@gmail.com on 28 Dec 2013 at 5:30

GoogleCodeExporter commented 8 years ago
Issue 365 has been merged into this issue.

Original comment by pnied...@gmail.com on 28 May 2014 at 4:40

GoogleCodeExporter commented 8 years ago
How do I convert the directory back to the jar in the work around?

Original comment by ada...@gmail.com on 16 Sep 2014 at 9:20