1

I have the following maven configuration for spock with spring.

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.test</groupId>
<artifactId>spock</artifactId>
<packaging>jar</packaging>
<version>1.0-SNAPSHOT</version>
<name>spock</name>
<url>http://maven.apache.org</url>

<properties>
    <!-- <maven.test.search.classdir>true</maven.test.search.classdir> -->
    <targetJdk>1.6</targetJdk>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <spring.version>3.2.1.RELEASE</spring.version>
</properties>

<dependencies>
    <!-- testing with spock -->
    <dependency>
        <groupId>org.spockframework</groupId>
        <artifactId>spock-core</artifactId>
        <version>0.6-groovy-1.8</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.codehaus.groovy</groupId>
        <artifactId>groovy</artifactId>
        <version>2.1.1</version>
        <scope>test</scope>
    </dependency>

    <!-- spring -->
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-core</artifactId>
        <version>${spring.version}</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-context</artifactId>
        <version>${spring.version}</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-beans</artifactId>
        <version>${spring.version}</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-test</artifactId>
        <version>${spring.version}</version>
        <scope>test</scope>
    </dependency>

    <dependency>
        <groupId>javax.inject</groupId>
        <artifactId>javax.inject</artifactId>
        <version>1</version>
    </dependency>


</dependencies>

<build>
    <plugins>
        <plugin>
            <groupId>org.codehaus.gmaven</groupId>
            <artifactId>gmaven-plugin</artifactId>
            <version>1.3</version>
            <configuration>
                <providerSelection>1.7</providerSelection>
            </configuration>
            <executions>
                <execution>
                    <goals>
                        <goal>testCompile</goal>
                    </goals>
                </execution>
            </executions>
            <dependencies>
                <dependency>
                    <groupId>org.codehaus.gmaven.runtime</groupId>
                    <artifactId>gmaven-runtime-1.7</artifactId>
                    <version>1.3</version>
                    <exclusions>
                        <exclusion>
                            <groupId>org.codehaus.groovy</groupId>
                            <artifactId>groovy-all</artifactId>
                        </exclusion>
                    </exclusions>
                </dependency>
                <dependency>
                    <groupId>org.codehaus.groovy</groupId>
                    <artifactId>groovy-all</artifactId>
                    <version>1.8.6</version>
                </dependency>
            </dependencies>
        </plugin>

    </plugins>
</build>

It works fine in the terminal but in STS/Eclipse, the IDE shows me the following error:

Plugin execution not covered by lifecycle configuration: org.codehaus.gmaven:gmaven-plugin:1.3:testCompile (execution: default, phase: test-compile)

I'm not sure what to add.

myborobudur
  • 4,385
  • 8
  • 40
  • 61
  • 1
    See answer to http://stackoverflow.com/questions/9142533/plugin-execution-not-covered-by-lifecycle-configuration-jbossas-7-ear-archetype.It could possibly solve your problem. – Adisesha Mar 20 '13 at 09:14
  • The quickfix to ignore the plugin did it, thanks! – myborobudur Mar 21 '13 at 14:20

1 Answers1

0

You can try with,

 <plugin>
        <groupId>org.codehaus.gmavenplus</groupId>
        <artifactId>gmavenplus-plugin</artifactId>
        <version>1.5</version>
        <executions>
            <execution>
                <goals>
                    <!-- Adds Groovy tests source to project's test source -->
                    <goal>addTestSources</goal>
                    <!-- Compiles spock tests -->
                    <goal>testCompile</goal>
                </goals>
            </execution>``
        </executions>
    </plugin>

And also switch to IntelliJ. It is a very good IDE.

Sachin Tiwari
  • 150
  • 13