0

I am trying to use spock framework in STS. But I am facing this error in my groovy class.

ERROR - The type groovy.transform.Generated cannot be resolved. It is indirectly referenced from required .class files

let me know, how to fix this issue.

Having this depedencies and plugin in pom.xml

    <dependency>
        <groupId>org.spockframework</groupId>
        <artifactId>spock-core</artifactId>
        <version>2.1-M2-groovy-3.0</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.spockframework</groupId>
        <artifactId>spock-spring</artifactId>
        <version>2.1-M2-groovy-3.0</version>
        <scope>test</scope>
    </dependency>

            <plugin>
                <groupId>org.codehaus.gmavenplus</groupId>
                <artifactId>gmavenplus-plugin</artifactId>
                <version>1.13.1</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>compileTests</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

Downloaded the groovy plugin from Eclipse marketplace

enter image description here

This is the Groovy complier version

enter image description here

  • What does your project look like in the Package Explorer? It is not clear what version of the groovy runtime is referenced. That is different from the compiler version. – emilles Dec 29 '21 at 00:46
  • Can you get https://github.com/spockframework/spock-example to work in STS? If so, compare that configuration with your own. – Leonard Brünings Dec 29 '21 at 21:40

0 Answers0