-
-
Save xlson/1251351 to your computer and use it in GitHub Desktop.
... | |
<dependencies> | |
<dependency> | |
<groupId>org.codehaus.groovy</groupId> | |
<artifactId>groovy-all</artifactId> | |
<version>1.8.0</version> | |
</dependency> | |
</dependencies> | |
<build> | |
<plugins> | |
<plugin> | |
<groupId>org.codehaus.gmaven</groupId> | |
<artifactId>gmaven-plugin</artifactId> | |
<version>1.3</version> | |
<dependencies> | |
<dependency> | |
<groupId>org.codehaus.groovy</groupId> | |
<artifactId>groovy-all</artifactId> | |
<version>1.8.0</version> | |
</dependency> | |
<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> | |
</dependencies> | |
<executions> | |
<execution> | |
<configuration> | |
<providerSelection>1.7</providerSelection> | |
</configuration> | |
<goals> | |
<goal>generateStubs</goal> | |
<goal>compile</goal> | |
<goal>generateTestStubs</goal> | |
<goal>testCompile</goal> | |
</goals> | |
</execution> | |
</executions> | |
</plugin> | |
</plugins> | |
</build> | |
... |
The Field annotation was introduced in Groovy 1.8.0. I guess it could get be that the providerSelection of 1.7 just won't allow me to use new features like that but I got the impression from the mailing list that it would.
The provider doesn't really know anything about language features, so it shouldn't matter, its really about providing compatibility with the API of the compiler/internals of the Groovy language version.
What does load.groovy look like?
I'm at home now and haven't got access to the code but I'll post it, or a simplified version of it, tomorrow. Thanks.
Thanks for the help. I took another look at running the file this morning and it turned out Eclipse was removing the groovy.transform.Field import on save.
eclipse is so nice and helpful ;-)
Always ;) Hopefully going back to IntelliJ next week.
Output:
[ERROR] Failed to execute goal org.codehaus.gmaven:gmaven-plugin:1.3:compile (default) on project monitoring: startup failed:
[ERROR] /home/leo/Code/Projects/monitoring/src/main/groovy/load.groovy: 11: unable to resolve class Field , unable to find class for annotation
[ERROR] @ line 11, column 1.
[ERROR] @field
[ERROR] ^
[ERROR]