AST Error with Groovy 1.8.0 in Eclipse

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

AST Error with Groovy 1.8.0 in Eclipse

Andrew Kennedy
Hi.

I am getting the following error in Eclipse (using the Groovy Compiler plugin version 1.8.0.xx-20110615-1900-e36, installed from: http://dist.codehaus.org/groovy/distributions/greclipse/snapshot/e3.6/) when I try to build projects (Maven based, but using the Groovy Nature) that use annotations, such as @InheritConstructors on .groovy files:

> Groovy:Not an ASTTransformation: org.codehaus.groovy.transform.InheritConstructorsASTTransformation declared by groovy.transform.InheritConstructors:  klass=class org.codehaus.groovy.transform.InheritConstructorsASTTransformation loaderForKlass=java.net.URLClassLoader@279d9a84 ASTTransformation.class loader=org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader@c58f769 SerializableObservables.groovy

The code that caused the above error is pretty simple, and basically looks like this:

    public class SerializableObservables {
        @InheritConstructors
        public static class SerializableObservableList extends ObservableList implements Serializable {}
    }

Is there something else I shopuld be be doing to use Eclipse ang Groovy 1.8.0 properly?

Cheers,
Andrew.
--
-- andrew d kennedy ? cloudsoft monterey : http://www.cloudsoftcorp.com/developers/ ;


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: AST Error with Groovy 1.8.0 in Eclipse

Andrew Eisenberg
Hi there,

I pasted your snippet into a groovy editor and didn't see the same
problem that you are seeing, so there must be something else going on.
 Can you answer a few questions:

1. Can you successfully do a mvn compile from the command line?
2. Are you using gmaven or groovy-eclipse-compiler in your pom?
3. What is the version of groovy that is being added to your project's
classpath container inside of Eclipse?

On Fri, Jun 17, 2011 at 6:11 AM, Andrew Kennedy
<[hidden email]> wrote:

> Hi.
>
> I am getting the following error in Eclipse (using the Groovy Compiler plugin version 1.8.0.xx-20110615-1900-e36, installed from: http://dist.codehaus.org/groovy/distributions/greclipse/snapshot/e3.6/) when I try to build projects (Maven based, but using the Groovy Nature) that use annotations, such as @InheritConstructors on .groovy files:
>
>> Groovy:Not an ASTTransformation: org.codehaus.groovy.transform.InheritConstructorsASTTransformation declared by groovy.transform.InheritConstructors:  klass=class org.codehaus.groovy.transform.InheritConstructorsASTTransformation loaderForKlass=java.net.URLClassLoader@279d9a84 ASTTransformation.class loader=org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader@c58f769 SerializableObservables.groovy
>
> The code that caused the above error is pretty simple, and basically looks like this:
>
>    public class SerializableObservables {
>        @InheritConstructors
>        public static class SerializableObservableList extends ObservableList implements Serializable {}
>    }
>
> Is there something else I shopuld be be doing to use Eclipse ang Groovy 1.8.0 properly?
>
> Cheers,
> Andrew.
> --
> -- andrew d kennedy ? cloudsoft monterey : http://www.cloudsoftcorp.com/developers/ ;
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>
>

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: AST Error with Groovy 1.8.0 in Eclipse

Andrew Kennedy
On 17 Jun 2011, at 17:35, Andrew Eisenberg wrote:
> I pasted your snippet into a groovy editor and didn't see the same
> problem that you are seeing, so there must be something else going on.

Thanks for the quick response.

> Can you answer a few questions:
>
> 1. Can you successfully do a mvn compile from the command line?

Yes. This always works, and my tests run and pass, so the runtime is working too, as well as the compiler. It's only the IDE integration that is causing me problems, although I'm not convinced I've configured Maven optimally...

> 2. Are you using gmaven or groovy-eclipse-compiler in your pom?

I use 'gmaven' (version 1.3, see properties definition fragment below) via the 'gmaven-plugin' which I configure as follows:

    <plugin>
        <groupId>org.codehaus.gmaven</groupId>
        <artifactId>gmaven-plugin</artifactId>
        <version>${gmaven.version}</version>
        <executions>
            <execution>
                <id>compile</id>
                <goals>
                    <goal>generateStubs</goal>
                    <goal>compile</goal>
                </goals>
                <configuration>
                    <sources>
                        <fileset>
                            <directory>${pom.basedir}/src/main/java</directory>
                            <includes>
                                <include>**/*.groovy</include>
                            </includes>
                        </fileset>
                    </sources>
                    <providerSelection>1.7</providerSelection>
                </configuration>
            </execution>
            <!-- test section elided for readability -->
        </executions>
        <dependencies>
            <dependency>
                <groupId>org.codehaus.gmaven.runtime</groupId>
                <artifactId>gmaven-runtime-1.7</artifactId>
                <version>${gmaven.version}</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>${groovy.version}</version>
            </dependency>
        </dependencies>
    </plugin>

In the POM I also specify properties and dependency management as follows:

    <dependency>
        <groupId>org.codehaus.groovy</groupId>
        <artifactId>groovy-all</artifactId>
        <version>${groovy.version}</version>
    </dependency>

    <properties>
        <gmaven.version>1.3</gmaven.version>
        <groovy.version>1.8.0</groovy.version>
    </properties>

Now, all this seems *very* complicated, probably too much so, but I don't think it's the source of the problem. Bear in mind that 'mvn compile' and 'mvn build install' from the command-line successfully build all of my projects, Groovy and Java code included, and run the tests as I expect.

This is strictly an Eclipse issue, as far as I can see. I'm not using maven to build inside Eclipse, either, I let the IDE handle all that itself. However, which of the two would you suggest for my maven build? Is there some benefit to using either 'gmaven' or 'groovy-eclipse-compiler' here?

> 3. What is the version of groovy that is being added to your project's
> classpath container inside of Eclipse?

Not sure what you mean here? In the 'Groovy Libraries' list I see 'groovy-all-1.8.0.jar' which comes from '/Developer/Applications/eclipse/plugins/org.codehaus.groovy_1.8.0.xx-20110615-1900-e36/lib/groovy-all-1.8.0.jar' apparently.

The instaled version of 'Groovy Compiler 1.8 Feature' (and other associated 'Groovy-Eclipse plugin' stuff, too) in Eclipse is 2.5.1.xx-20110615-1900-e36, although the 'Groovy Runtime Plug-in' versions are '1.8.0.xx-*' and '1.7.10.xx-*' with the same timestamp.

As an aside, the copyright for these bits and pieces is listed as 'Copyright SpringSource and others 2004, 2009' which should probably be updated ;)

My system runs OS X 10.6.7 and the Eclipse Platform SDK is version 3.6.2.M20110210-1200 (x86_64) if that helps?

> On Fri, Jun 17, 2011 at 6:11 AM, Andrew Kennedy <[hidden email]> wrote:
>> Hi.
>>
>> I am getting the following error in Eclipse (using the Groovy Compiler plugin version 1.8.0.xx-20110615-1900-e36, installed from: http://dist.codehaus.org/groovy/distributions/greclipse/snapshot/e3.6/) when I try to build projects (Maven based, but using the Groovy Nature) that use annotations, such as @InheritConstructors on .groovy files:
>>
>>> Groovy:Not an ASTTransformation: org.codehaus.groovy.transform.InheritConstructorsASTTransformation declared by groovy.transform.InheritConstructors:  klass=class org.codehaus.groovy.transform.InheritConstructorsASTTransformation loaderForKlass=java.net.URLClassLoader@279d9a84 ASTTransformation.class loader=org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader@c58f769 SerializableObservables.groovy
>>
>> The code that caused the above error is pretty simple, and basically looks like this:
>>
>>    public class SerializableObservables {
>>        @InheritConstructors
>>        public static class SerializableObservableList extends ObservableList implements Serializable {}
>>    }
>>
>> Is there something else I shopuld be be doing to use Eclipse ang Groovy 1.8.0 properly?

Cheers,
Andrew.
--
-- andrew d kennedy ? cloudsoft monterey : http://www.cloudsoftcorp.com/developers/ ;


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: AST Error with Groovy 1.8.0 in Eclipse

Andrew Eisenberg
Thanks for the info.  What I'm wondering is if you have 2 groovy jars
on your classpath.  One might be coming from the Groovy Libraries
classpath container, and the other might be coming from the maven
dependencies.  Also, check to make sure that in Preferences -> Groovy
-> Compiler, you are using 1.8.0.<something>.

On Fri, Jun 17, 2011 at 11:11 AM, Andrew Kennedy
<[hidden email]> wrote:

> On 17 Jun 2011, at 17:35, Andrew Eisenberg wrote:
>> I pasted your snippet into a groovy editor and didn't see the same
>> problem that you are seeing, so there must be something else going on.
>
> Thanks for the quick response.
>
>> Can you answer a few questions:
>>
>> 1. Can you successfully do a mvn compile from the command line?
>
> Yes. This always works, and my tests run and pass, so the runtime is working too, as well as the compiler. It's only the IDE integration that is causing me problems, although I'm not convinced I've configured Maven optimally...
>
>> 2. Are you using gmaven or groovy-eclipse-compiler in your pom?
>
> I use 'gmaven' (version 1.3, see properties definition fragment below) via the 'gmaven-plugin' which I configure as follows:
>
>    <plugin>
>        <groupId>org.codehaus.gmaven</groupId>
>        <artifactId>gmaven-plugin</artifactId>
>        <version>${gmaven.version}</version>
>        <executions>
>            <execution>
>                <id>compile</id>
>                <goals>
>                    <goal>generateStubs</goal>
>                    <goal>compile</goal>
>                </goals>
>                <configuration>
>                    <sources>
>                        <fileset>
>                            <directory>${pom.basedir}/src/main/java</directory>
>                            <includes>
>                                <include>**/*.groovy</include>
>                            </includes>
>                        </fileset>
>                    </sources>
>                    <providerSelection>1.7</providerSelection>
>                </configuration>
>            </execution>
>            <!-- test section elided for readability -->
>        </executions>
>        <dependencies>
>            <dependency>
>                <groupId>org.codehaus.gmaven.runtime</groupId>
>                <artifactId>gmaven-runtime-1.7</artifactId>
>                <version>${gmaven.version}</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>${groovy.version}</version>
>            </dependency>
>        </dependencies>
>    </plugin>
>
> In the POM I also specify properties and dependency management as follows:
>
>    <dependency>
>        <groupId>org.codehaus.groovy</groupId>
>        <artifactId>groovy-all</artifactId>
>        <version>${groovy.version}</version>
>    </dependency>
>
>    <properties>
>        <gmaven.version>1.3</gmaven.version>
>        <groovy.version>1.8.0</groovy.version>
>    </properties>
>
> Now, all this seems *very* complicated, probably too much so, but I don't think it's the source of the problem. Bear in mind that 'mvn compile' and 'mvn build install' from the command-line successfully build all of my projects, Groovy and Java code included, and run the tests as I expect.
>
> This is strictly an Eclipse issue, as far as I can see. I'm not using maven to build inside Eclipse, either, I let the IDE handle all that itself. However, which of the two would you suggest for my maven build? Is there some benefit to using either 'gmaven' or 'groovy-eclipse-compiler' here?
>
>> 3. What is the version of groovy that is being added to your project's
>> classpath container inside of Eclipse?
>
> Not sure what you mean here? In the 'Groovy Libraries' list I see 'groovy-all-1.8.0.jar' which comes from '/Developer/Applications/eclipse/plugins/org.codehaus.groovy_1.8.0.xx-20110615-1900-e36/lib/groovy-all-1.8.0.jar' apparently.
>
> The instaled version of 'Groovy Compiler 1.8 Feature' (and other associated 'Groovy-Eclipse plugin' stuff, too) in Eclipse is 2.5.1.xx-20110615-1900-e36, although the 'Groovy Runtime Plug-in' versions are '1.8.0.xx-*' and '1.7.10.xx-*' with the same timestamp.
>
> As an aside, the copyright for these bits and pieces is listed as 'Copyright SpringSource and others 2004, 2009' which should probably be updated ;)
>
> My system runs OS X 10.6.7 and the Eclipse Platform SDK is version 3.6.2.M20110210-1200 (x86_64) if that helps?
>
>> On Fri, Jun 17, 2011 at 6:11 AM, Andrew Kennedy <[hidden email]> wrote:
>>> Hi.
>>>
>>> I am getting the following error in Eclipse (using the Groovy Compiler plugin version 1.8.0.xx-20110615-1900-e36, installed from: http://dist.codehaus.org/groovy/distributions/greclipse/snapshot/e3.6/) when I try to build projects (Maven based, but using the Groovy Nature) that use annotations, such as @InheritConstructors on .groovy files:
>>>
>>>> Groovy:Not an ASTTransformation: org.codehaus.groovy.transform.InheritConstructorsASTTransformation declared by groovy.transform.InheritConstructors:  klass=class org.codehaus.groovy.transform.InheritConstructorsASTTransformation loaderForKlass=java.net.URLClassLoader@279d9a84 ASTTransformation.class loader=org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader@c58f769 SerializableObservables.groovy
>>>
>>> The code that caused the above error is pretty simple, and basically looks like this:
>>>
>>>    public class SerializableObservables {
>>>        @InheritConstructors
>>>        public static class SerializableObservableList extends ObservableList implements Serializable {}
>>>    }
>>>
>>> Is there something else I shopuld be be doing to use Eclipse ang Groovy 1.8.0 properly?
>
> Cheers,
> Andrew.
> --
> -- andrew d kennedy ? cloudsoft monterey : http://www.cloudsoftcorp.com/developers/ ;
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>
>

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: AST Error with Groovy 1.8.0 in Eclipse

Andrew Kennedy
On 17 Jun 2011, at 21:01, Andrew Eisenberg wrote:
> Thanks for the info.  What I'm wondering is if you have 2 groovy jars
> on your classpath.  One might be coming from the Groovy Libraries
> classpath container, and the other might be coming from the maven
> dependencies.

I do:

/Users/adk/.m2/repository/org/codehaus/groovy/groovy-all/1.8.0/groovy-all-1.8.0.jar

and:

/Developer/Applications/eclipse/plugins/org.codehaus.groovy_1.8.0.xx-20110615-1900-e36/lib/groovy-all-1.8.0.jar

Is this a problem? How could I fix this?

> Also, check to make sure that in Preferences -> Groovy
> -> Compiler, you are using 1.8.0.<something>.

Yes, the '1.8.0.xx-20110615-1900' version.

Cheers,
Andrew.

> On Fri, Jun 17, 2011 at 11:11 AM, Andrew Kennedy
> <[hidden email]> wrote:
>> On 17 Jun 2011, at 17:35, Andrew Eisenberg wrote:
>>> I pasted your snippet into a groovy editor and didn't see the same
>>> problem that you are seeing, so there must be something else going on.
>>
>> Thanks for the quick response.
>>
>>> Can you answer a few questions:
>>>
>>> 1. Can you successfully do a mvn compile from the command line?
>>
>> Yes. This always works, and my tests run and pass, so the runtime is working too, as well as the compiler. It's only the IDE integration that is causing me problems, although I'm not convinced I've configured Maven optimally...
>>
>>> 2. Are you using gmaven or groovy-eclipse-compiler in your pom?
>>
>> I use 'gmaven' (version 1.3, see properties definition fragment below) via the 'gmaven-plugin' which I configure as follows:
>>
>>    <plugin>
>>        <groupId>org.codehaus.gmaven</groupId>
>>        <artifactId>gmaven-plugin</artifactId>
>>        <version>${gmaven.version}</version>
>>        <executions>
>>            <execution>
>>                <id>compile</id>
>>                <goals>
>>                    <goal>generateStubs</goal>
>>                    <goal>compile</goal>
>>                </goals>
>>                <configuration>
>>                    <sources>
>>                        <fileset>
>>                            <directory>${pom.basedir}/src/main/java</directory>
>>                            <includes>
>>                                <include>**/*.groovy</include>
>>                            </includes>
>>                        </fileset>
>>                    </sources>
>>                    <providerSelection>1.7</providerSelection>
>>                </configuration>
>>            </execution>
>>            <!-- test section elided for readability -->
>>        </executions>
>>        <dependencies>
>>            <dependency>
>>                <groupId>org.codehaus.gmaven.runtime</groupId>
>>                <artifactId>gmaven-runtime-1.7</artifactId>
>>                <version>${gmaven.version}</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>${groovy.version}</version>
>>            </dependency>
>>        </dependencies>
>>    </plugin>
>>
>> In the POM I also specify properties and dependency management as follows:
>>
>>    <dependency>
>>        <groupId>org.codehaus.groovy</groupId>
>>        <artifactId>groovy-all</artifactId>
>>        <version>${groovy.version}</version>
>>    </dependency>
>>
>>    <properties>
>>        <gmaven.version>1.3</gmaven.version>
>>        <groovy.version>1.8.0</groovy.version>
>>    </properties>
>>
>> Now, all this seems *very* complicated, probably too much so, but I don't think it's the source of the problem. Bear in mind that 'mvn compile' and 'mvn build install' from the command-line successfully build all of my projects, Groovy and Java code included, and run the tests as I expect.
>>
>> This is strictly an Eclipse issue, as far as I can see. I'm not using maven to build inside Eclipse, either, I let the IDE handle all that itself. However, which of the two would you suggest for my maven build? Is there some benefit to using either 'gmaven' or 'groovy-eclipse-compiler' here?
>>
>>> 3. What is the version of groovy that is being added to your project's
>>> classpath container inside of Eclipse?
>>
>> Not sure what you mean here? In the 'Groovy Libraries' list I see 'groovy-all-1.8.0.jar' which comes from '/Developer/Applications/eclipse/plugins/org.codehaus.groovy_1.8.0.xx-20110615-1900-e36/lib/groovy-all-1.8.0.jar' apparently.
>>
>> The instaled version of 'Groovy Compiler 1.8 Feature' (and other associated 'Groovy-Eclipse plugin' stuff, too) in Eclipse is 2.5.1.xx-20110615-1900-e36, although the 'Groovy Runtime Plug-in' versions are '1.8.0.xx-*' and '1.7.10.xx-*' with the same timestamp.
>>
>> As an aside, the copyright for these bits and pieces is listed as 'Copyright SpringSource and others 2004, 2009' which should probably be updated ;)
>>
>> My system runs OS X 10.6.7 and the Eclipse Platform SDK is version 3.6.2.M20110210-1200 (x86_64) if that helps?
>>
>>> On Fri, Jun 17, 2011 at 6:11 AM, Andrew Kennedy <[hidden email]> wrote:
>>>> Hi.
>>>>
>>>> I am getting the following error in Eclipse (using the Groovy Compiler plugin version 1.8.0.xx-20110615-1900-e36, installed from: http://dist.codehaus.org/groovy/distributions/greclipse/snapshot/e3.6/) when I try to build projects (Maven based, but using the Groovy Nature) that use annotations, such as @InheritConstructors on .groovy files:
>>>>
>>>>> Groovy:Not an ASTTransformation: org.codehaus.groovy.transform.InheritConstructorsASTTransformation declared by groovy.transform.InheritConstructors:  klass=class org.codehaus.groovy.transform.InheritConstructorsASTTransformation loaderForKlass=java.net.URLClassLoader@279d9a84 ASTTransformation.class loader=org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader@c58f769 SerializableObservables.groovy
>>>>
>>>> The code that caused the above error is pretty simple, and basically looks like this:
>>>>
>>>>    public class SerializableObservables {
>>>>        @InheritConstructors
>>>>        public static class SerializableObservableList extends ObservableList implements Serializable {}
>>>>    }
>>>>
>>>> Is there something else I shopuld be be doing to use Eclipse ang Groovy 1.8.0 properly?
>>
>> Cheers,
>> Andrew.
>> --
>> -- andrew d kennedy ? cloudsoft monterey : http://www.cloudsoftcorp.com/developers/ ;
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe from this list, please visit:
>>
>>    http://xircles.codehaus.org/manage_email
>>
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>

--
-- andrew d kennedy ? cloudsoft monterey : http://www.cloudsoftcorp.com/developers/ ;


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: AST Error with Groovy 1.8.0 in Eclipse

Andrew Eisenberg
Just remove the version coming in from the Groovy Libraries classpath
container from your build path.  Right click on them -> Build Path ->
Remove from Build Path.

This may solve your problem.  It may be that the annotation is coming
from one jar, but the AST transform class is coming from another and
this is the cause of the confusion.  If this doesn't fix, then there
are more things that we can try.

On Sat, Jun 18, 2011 at 10:53 AM, Andrew Kennedy
<[hidden email]> wrote:

> On 17 Jun 2011, at 21:01, Andrew Eisenberg wrote:
>> Thanks for the info.  What I'm wondering is if you have 2 groovy jars
>> on your classpath.  One might be coming from the Groovy Libraries
>> classpath container, and the other might be coming from the maven
>> dependencies.
>
> I do:
>
> /Users/adk/.m2/repository/org/codehaus/groovy/groovy-all/1.8.0/groovy-all-1.8.0.jar
>
> and:
>
> /Developer/Applications/eclipse/plugins/org.codehaus.groovy_1.8.0.xx-20110615-1900-e36/lib/groovy-all-1.8.0.jar
>
> Is this a problem? How could I fix this?
>
>> Also, check to make sure that in Preferences -> Groovy
>> -> Compiler, you are using 1.8.0.<something>.
>
> Yes, the '1.8.0.xx-20110615-1900' version.
>
> Cheers,
> Andrew.
>
>> On Fri, Jun 17, 2011 at 11:11 AM, Andrew Kennedy
>> <[hidden email]> wrote:
>>> On 17 Jun 2011, at 17:35, Andrew Eisenberg wrote:
>>>> I pasted your snippet into a groovy editor and didn't see the same
>>>> problem that you are seeing, so there must be something else going on.
>>>
>>> Thanks for the quick response.
>>>
>>>> Can you answer a few questions:
>>>>
>>>> 1. Can you successfully do a mvn compile from the command line?
>>>
>>> Yes. This always works, and my tests run and pass, so the runtime is working too, as well as the compiler. It's only the IDE integration that is causing me problems, although I'm not convinced I've configured Maven optimally...
>>>
>>>> 2. Are you using gmaven or groovy-eclipse-compiler in your pom?
>>>
>>> I use 'gmaven' (version 1.3, see properties definition fragment below) via the 'gmaven-plugin' which I configure as follows:
>>>
>>>    <plugin>
>>>        <groupId>org.codehaus.gmaven</groupId>
>>>        <artifactId>gmaven-plugin</artifactId>
>>>        <version>${gmaven.version}</version>
>>>        <executions>
>>>            <execution>
>>>                <id>compile</id>
>>>                <goals>
>>>                    <goal>generateStubs</goal>
>>>                    <goal>compile</goal>
>>>                </goals>
>>>                <configuration>
>>>                    <sources>
>>>                        <fileset>
>>>                            <directory>${pom.basedir}/src/main/java</directory>
>>>                            <includes>
>>>                                <include>**/*.groovy</include>
>>>                            </includes>
>>>                        </fileset>
>>>                    </sources>
>>>                    <providerSelection>1.7</providerSelection>
>>>                </configuration>
>>>            </execution>
>>>            <!-- test section elided for readability -->
>>>        </executions>
>>>        <dependencies>
>>>            <dependency>
>>>                <groupId>org.codehaus.gmaven.runtime</groupId>
>>>                <artifactId>gmaven-runtime-1.7</artifactId>
>>>                <version>${gmaven.version}</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>${groovy.version}</version>
>>>            </dependency>
>>>        </dependencies>
>>>    </plugin>
>>>
>>> In the POM I also specify properties and dependency management as follows:
>>>
>>>    <dependency>
>>>        <groupId>org.codehaus.groovy</groupId>
>>>        <artifactId>groovy-all</artifactId>
>>>        <version>${groovy.version}</version>
>>>    </dependency>
>>>
>>>    <properties>
>>>        <gmaven.version>1.3</gmaven.version>
>>>        <groovy.version>1.8.0</groovy.version>
>>>    </properties>
>>>
>>> Now, all this seems *very* complicated, probably too much so, but I don't think it's the source of the problem. Bear in mind that 'mvn compile' and 'mvn build install' from the command-line successfully build all of my projects, Groovy and Java code included, and run the tests as I expect.
>>>
>>> This is strictly an Eclipse issue, as far as I can see. I'm not using maven to build inside Eclipse, either, I let the IDE handle all that itself. However, which of the two would you suggest for my maven build? Is there some benefit to using either 'gmaven' or 'groovy-eclipse-compiler' here?
>>>
>>>> 3. What is the version of groovy that is being added to your project's
>>>> classpath container inside of Eclipse?
>>>
>>> Not sure what you mean here? In the 'Groovy Libraries' list I see 'groovy-all-1.8.0.jar' which comes from '/Developer/Applications/eclipse/plugins/org.codehaus.groovy_1.8.0.xx-20110615-1900-e36/lib/groovy-all-1.8.0.jar' apparently.
>>>
>>> The instaled version of 'Groovy Compiler 1.8 Feature' (and other associated 'Groovy-Eclipse plugin' stuff, too) in Eclipse is 2.5.1.xx-20110615-1900-e36, although the 'Groovy Runtime Plug-in' versions are '1.8.0.xx-*' and '1.7.10.xx-*' with the same timestamp.
>>>
>>> As an aside, the copyright for these bits and pieces is listed as 'Copyright SpringSource and others 2004, 2009' which should probably be updated ;)
>>>
>>> My system runs OS X 10.6.7 and the Eclipse Platform SDK is version 3.6.2.M20110210-1200 (x86_64) if that helps?
>>>
>>>> On Fri, Jun 17, 2011 at 6:11 AM, Andrew Kennedy <[hidden email]> wrote:
>>>>> Hi.
>>>>>
>>>>> I am getting the following error in Eclipse (using the Groovy Compiler plugin version 1.8.0.xx-20110615-1900-e36, installed from: http://dist.codehaus.org/groovy/distributions/greclipse/snapshot/e3.6/) when I try to build projects (Maven based, but using the Groovy Nature) that use annotations, such as @InheritConstructors on .groovy files:
>>>>>
>>>>>> Groovy:Not an ASTTransformation: org.codehaus.groovy.transform.InheritConstructorsASTTransformation declared by groovy.transform.InheritConstructors:  klass=class org.codehaus.groovy.transform.InheritConstructorsASTTransformation loaderForKlass=java.net.URLClassLoader@279d9a84 ASTTransformation.class loader=org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader@c58f769 SerializableObservables.groovy
>>>>>
>>>>> The code that caused the above error is pretty simple, and basically looks like this:
>>>>>
>>>>>    public class SerializableObservables {
>>>>>        @InheritConstructors
>>>>>        public static class SerializableObservableList extends ObservableList implements Serializable {}
>>>>>    }
>>>>>
>>>>> Is there something else I shopuld be be doing to use Eclipse ang Groovy 1.8.0 properly?
>>>
>>> Cheers,
>>> Andrew.
>>> --
>>> -- andrew d kennedy ? cloudsoft monterey : http://www.cloudsoftcorp.com/developers/ ;
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe from this list, please visit:
>>>
>>>    http://xircles.codehaus.org/manage_email
>>>
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe from this list, please visit:
>>
>>    http://xircles.codehaus.org/manage_email
>>
>>
>
> --
> -- andrew d kennedy ? cloudsoft monterey : http://www.cloudsoftcorp.com/developers/ ;
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>
>

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: AST Error with Groovy 1.8.0 in Eclipse

Andrew Kennedy
On 18 Jun 2011, at 21:12, Andrew Eisenberg wrote:
> Just remove the version coming in from the Groovy Libraries classpath
> container from your build path.  Right click on them -> Build Path ->
> Remove from Build Path.

OK, but all I can remove is the *entire* 'Groovy Libraries' set of JARs, not just the individual 'groovy-all-1.8.0' file.

Having said that, I'll try doing just that, since the appropriate runtimes *should* have been brought in by Maven anyway. I'm assuming that the project should still have a 'Groovy Nature' to allow it to behave correctly regarding .groovy files referencing Java .class files and vice versa?

> This may solve your problem.  It may be that the annotation is coming
> from one jar, but the AST transform class is coming from another and
> this is the cause of the confusion.  If this doesn't fix, then there
> are more things that we can try.

One difficulty is that the issue is not immediately or reliably replicable. However, I haqven't seen it re-occur for a while since removing the duplicated libraries, and I will ask some colleagues to try the same in their environments.

Secondary to this, am I doing the right thing in the Maven build to obtain a Groovy 1.8.0 runtime? Google searches and similar resources suggested the plugin configuration I pasted earlier/below, but this seems to rely on pulling in a 1.7 runtime to make the gmaven 1.3 part of the build work, and I'm not comfortable with this. Admittedly this hasn't caused any problems (yet) but it would be nice to know we are going in the right direction... Of course, this does give the following two classes in the 'Maven Libraries' part of the Eclipse classpath:

        /Users/adk/.m2/repository/org/codehaus/groovy/groovy-all/1.8.0/groovy-all-1.8.0.jar
        /Users/adk/.m2/repository/org/codehaus/gmaven/runtime/gmaven-runtime-1.7/1.3/gmaven-runtime-1.7-1.3.jar

All the resources I looked up suggested that the 1.7 provider was the correct one to use, even for Groovy 1.8.0, and this is what I have in the 'gmaven-plugin' configuration:

        <providerSelection>1.7</providerSelection>

Thanks,
Andrew.

> On Sat, Jun 18, 2011 at 10:53 AM, Andrew Kennedy
> <[hidden email]> wrote:
>> On 17 Jun 2011, at 21:01, Andrew Eisenberg wrote:
>>> Thanks for the info.  What I'm wondering is if you have 2 groovy jars
>>> on your classpath.  One might be coming from the Groovy Libraries
>>> classpath container, and the other might be coming from the maven
>>> dependencies.
>>
>> I do:
>>
>> /Users/adk/.m2/repository/org/codehaus/groovy/groovy-all/1.8.0/groovy-all-1.8.0.jar
>>
>> and:
>>
>> /Developer/Applications/eclipse/plugins/org.codehaus.groovy_1.8.0.xx-20110615-1900-e36/lib/groovy-all-1.8.0.jar
>>
>> Is this a problem? How could I fix this?
>>
>>> Also, check to make sure that in Preferences -> Groovy
>>> -> Compiler, you are using 1.8.0.<something>.
>>
>> Yes, the '1.8.0.xx-20110615-1900' version.
>>
>> Cheers,
>> Andrew.
>>
>>> On Fri, Jun 17, 2011 at 11:11 AM, Andrew Kennedy
>>> <[hidden email]> wrote:
>>>> On 17 Jun 2011, at 17:35, Andrew Eisenberg wrote:
>>>>> I pasted your snippet into a groovy editor and didn't see the same
>>>>> problem that you are seeing, so there must be something else going on.
>>>>
>>>> Thanks for the quick response.
>>>>
>>>>> Can you answer a few questions:
>>>>>
>>>>> 1. Can you successfully do a mvn compile from the command line?
>>>>
>>>> Yes. This always works, and my tests run and pass, so the runtime is working too, as well as the compiler. It's only the IDE integration that is causing me problems, although I'm not convinced I've configured Maven optimally...
>>>>
>>>>> 2. Are you using gmaven or groovy-eclipse-compiler in your pom?
>>>>
>>>> I use 'gmaven' (version 1.3, see properties definition fragment below) via the 'gmaven-plugin' which I configure as follows:
>>>>
>>>>   <plugin>
>>>>       <groupId>org.codehaus.gmaven</groupId>
>>>>       <artifactId>gmaven-plugin</artifactId>
>>>>       <version>${gmaven.version}</version>
>>>>       <executions>
>>>>           <execution>
>>>>               <id>compile</id>
>>>>               <goals>
>>>>                   <goal>generateStubs</goal>
>>>>                   <goal>compile</goal>
>>>>               </goals>
>>>>               <configuration>
>>>>                   <sources>
>>>>                       <fileset>
>>>>                           <directory>${pom.basedir}/src/main/java</directory>
>>>>                           <includes>
>>>>                               <include>**/*.groovy</include>
>>>>                           </includes>
>>>>                       </fileset>
>>>>                   </sources>
>>>>                   <providerSelection>1.7</providerSelection>
>>>>               </configuration>
>>>>           </execution>
>>>>           <!-- test section elided for readability -->
>>>>       </executions>
>>>>       <dependencies>
>>>>           <dependency>
>>>>               <groupId>org.codehaus.gmaven.runtime</groupId>
>>>>               <artifactId>gmaven-runtime-1.7</artifactId>
>>>>               <version>${gmaven.version}</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>${groovy.version}</version>
>>>>           </dependency>
>>>>       </dependencies>
>>>>   </plugin>
>>>>
>>>> In the POM I also specify properties and dependency management as follows:
>>>>
>>>>   <dependency>
>>>>       <groupId>org.codehaus.groovy</groupId>
>>>>       <artifactId>groovy-all</artifactId>
>>>>       <version>${groovy.version}</version>
>>>>   </dependency>
>>>>
>>>>   <properties>
>>>>       <gmaven.version>1.3</gmaven.version>
>>>>       <groovy.version>1.8.0</groovy.version>
>>>>   </properties>
>>>>
>>>> Now, all this seems *very* complicated, probably too much so, but I don't think it's the source of the problem. Bear in mind that 'mvn compile' and 'mvn build install' from the command-line successfully build all of my projects, Groovy and Java code included, and run the tests as I expect.
>>>>
>>>> This is strictly an Eclipse issue, as far as I can see. I'm not using maven to build inside Eclipse, either, I let the IDE handle all that itself. However, which of the two would you suggest for my maven build? Is there some benefit to using either 'gmaven' or 'groovy-eclipse-compiler' here?
>>>>
>>>>> 3. What is the version of groovy that is being added to your project's
>>>>> classpath container inside of Eclipse?
>>>>
>>>> Not sure what you mean here? In the 'Groovy Libraries' list I see 'groovy-all-1.8.0.jar' which comes from '/Developer/Applications/eclipse/plugins/org.codehaus.groovy_1.8.0.xx-20110615-1900-e36/lib/groovy-all-1.8.0.jar' apparently.
>>>>
>>>> The instaled version of 'Groovy Compiler 1.8 Feature' (and other associated 'Groovy-Eclipse plugin' stuff, too) in Eclipse is 2.5.1.xx-20110615-1900-e36, although the 'Groovy Runtime Plug-in' versions are '1.8.0.xx-*' and '1.7.10.xx-*' with the same timestamp.
>>>>
>>>> As an aside, the copyright for these bits and pieces is listed as 'Copyright SpringSource and others 2004, 2009' which should probably be updated ;)
>>>>
>>>> My system runs OS X 10.6.7 and the Eclipse Platform SDK is version 3.6.2.M20110210-1200 (x86_64) if that helps?
>>>>
>>>>> On Fri, Jun 17, 2011 at 6:11 AM, Andrew Kennedy <[hidden email]> wrote:
>>>>>> Hi.
>>>>>>
>>>>>> I am getting the following error in Eclipse (using the Groovy Compiler plugin version 1.8.0.xx-20110615-1900-e36, installed from: http://dist.codehaus.org/groovy/distributions/greclipse/snapshot/e3.6/) when I try to build projects (Maven based, but using the Groovy Nature) that use annotations, such as @InheritConstructors on .groovy files:
>>>>>>
>>>>>>> Groovy:Not an ASTTransformation: org.codehaus.groovy.transform.InheritConstructorsASTTransformation declared by groovy.transform.InheritConstructors:  klass=class org.codehaus.groovy.transform.InheritConstructorsASTTransformation loaderForKlass=java.net.URLClassLoader@279d9a84 ASTTransformation.class loader=org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader@c58f769 SerializableObservables.groovy
>>>>>>
>>>>>> The code that caused the above error is pretty simple, and basically looks like this:
>>>>>>
>>>>>>   public class SerializableObservables {
>>>>>>       @InheritConstructors
>>>>>>       public static class SerializableObservableList extends ObservableList implements Serializable {}
>>>>>>   }
>>>>>>
>>>>>> Is there something else I shopuld be be doing to use Eclipse ang Groovy 1.8.0 properly?

--
-- andrew d kennedy ? cloudsoft monterey : http://www.cloudsoftcorp.com/developers/ ;


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: AST Error with Groovy 1.8.0 in Eclipse

Andrew Kennedy
Hi.

Even doing that, I still get the 'Groovy:Not an ASTTransformation' error. The .groovy file has been simplified to:

        import groovy.transform.InheritConstructors
        import groovy.util.ObservableList

        import java.io.Serializable

        @InheritConstructors
        public class SerializableObservableList extends ObservableList implements Serializable {}

A 'Clean' followed by a 'Build Project' in Eclipse will normally resolve the problem.

Andrew.

On 20 Jun 2011, at 10:25, Andrew Kennedy wrote:

> On 18 Jun 2011, at 21:12, Andrew Eisenberg wrote:
>> Just remove the version coming in from the Groovy Libraries classpath
>> container from your build path.  Right click on them -> Build Path ->
>> Remove from Build Path.
>
> OK, but all I can remove is the *entire* 'Groovy Libraries' set of JARs, not just the individual 'groovy-all-1.8.0' file.
>
> Having said that, I'll try doing just that, since the appropriate runtimes *should* have been brought in by Maven anyway. I'm assuming that the project should still have a 'Groovy Nature' to allow it to behave correctly regarding .groovy files referencing Java .class files and vice versa?
>
>> This may solve your problem.  It may be that the annotation is coming
>> from one jar, but the AST transform class is coming from another and
>> this is the cause of the confusion.  If this doesn't fix, then there
>> are more things that we can try.
>
> One difficulty is that the issue is not immediately or reliably replicable. However, I haqven't seen it re-occur for a while since removing the duplicated libraries, and I will ask some colleagues to try the same in their environments.
>
> Secondary to this, am I doing the right thing in the Maven build to obtain a Groovy 1.8.0 runtime? Google searches and similar resources suggested the plugin configuration I pasted earlier/below, but this seems to rely on pulling in a 1.7 runtime to make the gmaven 1.3 part of the build work, and I'm not comfortable with this. Admittedly this hasn't caused any problems (yet) but it would be nice to know we are going in the right direction... Of course, this does give the following two classes in the 'Maven Libraries' part of the Eclipse classpath:
>
> /Users/adk/.m2/repository/org/codehaus/groovy/groovy-all/1.8.0/groovy-all-1.8.0.jar
> /Users/adk/.m2/repository/org/codehaus/gmaven/runtime/gmaven-runtime-1.7/1.3/gmaven-runtime-1.7-1.3.jar
>
> All the resources I looked up suggested that the 1.7 provider was the correct one to use, even for Groovy 1.8.0, and this is what I have in the 'gmaven-plugin' configuration:
>
> <providerSelection>1.7</providerSelection>
>
> Thanks,
> Andrew.
>
>> On Sat, Jun 18, 2011 at 10:53 AM, Andrew Kennedy
>> <[hidden email]> wrote:
>>> On 17 Jun 2011, at 21:01, Andrew Eisenberg wrote:
>>>> Thanks for the info.  What I'm wondering is if you have 2 groovy jars
>>>> on your classpath.  One might be coming from the Groovy Libraries
>>>> classpath container, and the other might be coming from the maven
>>>> dependencies.
>>>
>>> I do:
>>>
>>> /Users/adk/.m2/repository/org/codehaus/groovy/groovy-all/1.8.0/groovy-all-1.8.0.jar
>>>
>>> and:
>>>
>>> /Developer/Applications/eclipse/plugins/org.codehaus.groovy_1.8.0.xx-20110615-1900-e36/lib/groovy-all-1.8.0.jar
>>>
>>> Is this a problem? How could I fix this?
>>>
>>>> Also, check to make sure that in Preferences -> Groovy
>>>> -> Compiler, you are using 1.8.0.<something>.
>>>
>>> Yes, the '1.8.0.xx-20110615-1900' version.
>>>
>>> Cheers,
>>> Andrew.
>>>
>>>> On Fri, Jun 17, 2011 at 11:11 AM, Andrew Kennedy
>>>> <[hidden email]> wrote:
>>>>> On 17 Jun 2011, at 17:35, Andrew Eisenberg wrote:
>>>>>> I pasted your snippet into a groovy editor and didn't see the same
>>>>>> problem that you are seeing, so there must be something else going on.
>>>>>
>>>>> Thanks for the quick response.
>>>>>
>>>>>> Can you answer a few questions:
>>>>>>
>>>>>> 1. Can you successfully do a mvn compile from the command line?
>>>>>
>>>>> Yes. This always works, and my tests run and pass, so the runtime is working too, as well as the compiler. It's only the IDE integration that is causing me problems, although I'm not convinced I've configured Maven optimally...
>>>>>
>>>>>> 2. Are you using gmaven or groovy-eclipse-compiler in your pom?
>>>>>
>>>>> I use 'gmaven' (version 1.3, see properties definition fragment below) via the 'gmaven-plugin' which I configure as follows:
>>>>>
>>>>>  <plugin>
>>>>>      <groupId>org.codehaus.gmaven</groupId>
>>>>>      <artifactId>gmaven-plugin</artifactId>
>>>>>      <version>${gmaven.version}</version>
>>>>>      <executions>
>>>>>          <execution>
>>>>>              <id>compile</id>
>>>>>              <goals>
>>>>>                  <goal>generateStubs</goal>
>>>>>                  <goal>compile</goal>
>>>>>              </goals>
>>>>>              <configuration>
>>>>>                  <sources>
>>>>>                      <fileset>
>>>>>                          <directory>${pom.basedir}/src/main/java</directory>
>>>>>                          <includes>
>>>>>                              <include>**/*.groovy</include>
>>>>>                          </includes>
>>>>>                      </fileset>
>>>>>                  </sources>
>>>>>                  <providerSelection>1.7</providerSelection>
>>>>>              </configuration>
>>>>>          </execution>
>>>>>          <!-- test section elided for readability -->
>>>>>      </executions>
>>>>>      <dependencies>
>>>>>          <dependency>
>>>>>              <groupId>org.codehaus.gmaven.runtime</groupId>
>>>>>              <artifactId>gmaven-runtime-1.7</artifactId>
>>>>>              <version>${gmaven.version}</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>${groovy.version}</version>
>>>>>          </dependency>
>>>>>      </dependencies>
>>>>>  </plugin>
>>>>>
>>>>> In the POM I also specify properties and dependency management as follows:
>>>>>
>>>>>  <dependency>
>>>>>      <groupId>org.codehaus.groovy</groupId>
>>>>>      <artifactId>groovy-all</artifactId>
>>>>>      <version>${groovy.version}</version>
>>>>>  </dependency>
>>>>>
>>>>>  <properties>
>>>>>      <gmaven.version>1.3</gmaven.version>
>>>>>      <groovy.version>1.8.0</groovy.version>
>>>>>  </properties>
>>>>>
>>>>> Now, all this seems *very* complicated, probably too much so, but I don't think it's the source of the problem. Bear in mind that 'mvn compile' and 'mvn build install' from the command-line successfully build all of my projects, Groovy and Java code included, and run the tests as I expect.
>>>>>
>>>>> This is strictly an Eclipse issue, as far as I can see. I'm not using maven to build inside Eclipse, either, I let the IDE handle all that itself. However, which of the two would you suggest for my maven build? Is there some benefit to using either 'gmaven' or 'groovy-eclipse-compiler' here?
>>>>>
>>>>>> 3. What is the version of groovy that is being added to your project's
>>>>>> classpath container inside of Eclipse?
>>>>>
>>>>> Not sure what you mean here? In the 'Groovy Libraries' list I see 'groovy-all-1.8.0.jar' which comes from '/Developer/Applications/eclipse/plugins/org.codehaus.groovy_1.8.0.xx-20110615-1900-e36/lib/groovy-all-1.8.0.jar' apparently.
>>>>>
>>>>> The instaled version of 'Groovy Compiler 1.8 Feature' (and other associated 'Groovy-Eclipse plugin' stuff, too) in Eclipse is 2.5.1.xx-20110615-1900-e36, although the 'Groovy Runtime Plug-in' versions are '1.8.0.xx-*' and '1.7.10.xx-*' with the same timestamp.
>>>>>
>>>>> As an aside, the copyright for these bits and pieces is listed as 'Copyright SpringSource and others 2004, 2009' which should probably be updated ;)
>>>>>
>>>>> My system runs OS X 10.6.7 and the Eclipse Platform SDK is version 3.6.2.M20110210-1200 (x86_64) if that helps?
>>>>>
>>>>>> On Fri, Jun 17, 2011 at 6:11 AM, Andrew Kennedy <[hidden email]> wrote:
>>>>>>> Hi.
>>>>>>>
>>>>>>> I am getting the following error in Eclipse (using the Groovy Compiler plugin version 1.8.0.xx-20110615-1900-e36, installed from: http://dist.codehaus.org/groovy/distributions/greclipse/snapshot/e3.6/) when I try to build projects (Maven based, but using the Groovy Nature) that use annotations, such as @InheritConstructors on .groovy files:
>>>>>>>
>>>>>>>> Groovy:Not an ASTTransformation: org.codehaus.groovy.transform.InheritConstructorsASTTransformation declared by groovy.transform.InheritConstructors:  klass=class org.codehaus.groovy.transform.InheritConstructorsASTTransformation loaderForKlass=java.net.URLClassLoader@279d9a84 ASTTransformation.class loader=org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader@c58f769 SerializableObservables.groovy
>>>>>>>
>>>>>>> The code that caused the above error is pretty simple, and basically looks like this:
>>>>>>>
>>>>>>>  public class SerializableObservables {
>>>>>>>      @InheritConstructors
>>>>>>>      public static class SerializableObservableList extends ObservableList implements Serializable {}
>>>>>>>  }
>>>>>>>
>>>>>>> Is there something else I shopuld be be doing to use Eclipse ang Groovy 1.8.0 properly?
>
> --
> -- andrew d kennedy ? cloudsoft monterey : http://www.cloudsoftcorp.com/developers/ ;
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>

--
-- andrew d kennedy ? cloudsoft monterey : http://www.cloudsoftcorp.com/developers/ ;


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: AST Error with Groovy 1.8.0 in Eclipse

Andrew Eisenberg
> OK, but all I can remove is the *entire* 'Groovy Libraries' set of JARs, not just the individual 'groovy-all-1.8.0' file.
>
> Having said that, I'll try doing just that, since the appropriate runtimes *should* have been brought in by Maven anyway. I'm assuming that the project should still have a 'Groovy Nature' to allow it to
> behave correctly regarding .groovy files referencing Java .class files and vice versa?

Yes, this is what I was suggesting.

> Secondary to this, am I doing the right thing in the Maven build to obtain a Groovy 1.8.0 runtime? Google searches and similar resources suggested the plugin configuration I pasted earlier/below, but
> this seems to rely on pulling in a 1.7 runtime to make the gmaven 1.3 part of the build work, and I'm not comfortable with this. Admittedly this hasn't caused any problems (yet) but it would be nice to
> know we are going in the right direction... Of course, this does give the following two classes in the 'Maven Libraries' part of the Eclipse classpath:
>
>        /Users/adk/.m2/repository/org/codehaus/groovy/groovy-all/1.8.0/groovy-all-1.8.0.jar
>        /Users/adk/.m2/repository/org/codehaus/gmaven/runtime/gmaven-runtime-1.7/1.3/gmaven-runtime-1.7-1.3.jar
>
> All the resources I looked up suggested that the 1.7 provider was the correct one to use, even for Groovy 1.8.0, and this is what I have in the 'gmaven-plugin' configuration:
>
>        <providerSelection>1.7</providerSelection>

I don't know much about gmaven, but I do know that it causes some
esoteric problems.  It is no longer directly supported by the Groovy
community.  Instead, I would recommend the groovy-eclipse-compiler for
maven http://groovy.codehaus.org/Groovy-Eclipse+compiler+plugin+for+Maven.
 It will have its first general release soon and is being supported by
me.  I don't know if it would fix your current problem (and if things
are otherwise running fine under gmaven, then perhaps there's no point
in moving).

> Even doing that, I still get the 'Groovy:Not an ASTTransformation' error. The .groovy file has been simplified to:
>
>        import groovy.transform.InheritConstructors
>        import groovy.util.ObservableList
>
>        import java.io.Serializable
>
>        @InheritConstructors
>        public class SerializableObservableList extends ObservableList implements Serializable {}
>
> A 'Clean' followed by a 'Build Project' in Eclipse will normally resolve the problem.

Hmmm...this is starting to not look good.  If you still have multiplr
groovy jars on your classpath (as you show above), then this might be
the cause, but it could also be a problem with the way Eclipse handles
the incremental compilation of the inherit constructors AST transform.
 We'll discuss this at today's meeting and see what we can do about
this.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: AST Error with Groovy 1.8.0 in Eclipse

Andrew Eisenberg
I just raised http://jira.codehaus.org/browse/GRECLIPSE-1090

Please make sure that you still get this problem when you only have
one version of the Groovy jars on your classpath.  Also, please add
any further comments to the bug.  Thanks.

On Mon, Jun 20, 2011 at 8:33 AM, Andrew Eisenberg <[hidden email]> wrote:

>> OK, but all I can remove is the *entire* 'Groovy Libraries' set of JARs, not just the individual 'groovy-all-1.8.0' file.
>>
>> Having said that, I'll try doing just that, since the appropriate runtimes *should* have been brought in by Maven anyway. I'm assuming that the project should still have a 'Groovy Nature' to allow it to
>> behave correctly regarding .groovy files referencing Java .class files and vice versa?
>
> Yes, this is what I was suggesting.
>
>> Secondary to this, am I doing the right thing in the Maven build to obtain a Groovy 1.8.0 runtime? Google searches and similar resources suggested the plugin configuration I pasted earlier/below, but
>> this seems to rely on pulling in a 1.7 runtime to make the gmaven 1.3 part of the build work, and I'm not comfortable with this. Admittedly this hasn't caused any problems (yet) but it would be nice to
>> know we are going in the right direction... Of course, this does give the following two classes in the 'Maven Libraries' part of the Eclipse classpath:
>>
>>        /Users/adk/.m2/repository/org/codehaus/groovy/groovy-all/1.8.0/groovy-all-1.8.0.jar
>>        /Users/adk/.m2/repository/org/codehaus/gmaven/runtime/gmaven-runtime-1.7/1.3/gmaven-runtime-1.7-1.3.jar
>>
>> All the resources I looked up suggested that the 1.7 provider was the correct one to use, even for Groovy 1.8.0, and this is what I have in the 'gmaven-plugin' configuration:
>>
>>        <providerSelection>1.7</providerSelection>
>
> I don't know much about gmaven, but I do know that it causes some
> esoteric problems.  It is no longer directly supported by the Groovy
> community.  Instead, I would recommend the groovy-eclipse-compiler for
> maven http://groovy.codehaus.org/Groovy-Eclipse+compiler+plugin+for+Maven.
>  It will have its first general release soon and is being supported by
> me.  I don't know if it would fix your current problem (and if things
> are otherwise running fine under gmaven, then perhaps there's no point
> in moving).
>
>> Even doing that, I still get the 'Groovy:Not an ASTTransformation' error. The .groovy file has been simplified to:
>>
>>        import groovy.transform.InheritConstructors
>>        import groovy.util.ObservableList
>>
>>        import java.io.Serializable
>>
>>        @InheritConstructors
>>        public class SerializableObservableList extends ObservableList implements Serializable {}
>>
>> A 'Clean' followed by a 'Build Project' in Eclipse will normally resolve the problem.
>
> Hmmm...this is starting to not look good.  If you still have multiplr
> groovy jars on your classpath (as you show above), then this might be
> the cause, but it could also be a problem with the way Eclipse handles
> the incremental compilation of the inherit constructors AST transform.
>  We'll discuss this at today's meeting and see what we can do about
> this.
>

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email