Strange behaviour with groovy-maven-eclipse 2.8.0-01

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

Strange behaviour with groovy-maven-eclipse 2.8.0-01

Josselin Lebret
Hi everyone

I'm trying to build a simple groovy webapp with Jersey 2 API using the groovy eclipse compiler maven plugin . Note that I am note using the eclipse plugin but only command line maven (I'm using maven 3.1.0 on windows)

Here's the extract from my POM about the compiler settings

<plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.0</version>
                <configuration>
                    <compilerId>groovy-eclipse-compiler</compilerId>
                    <verbose>true</verbose>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>org.codehaus.groovy</groupId>
                        <artifactId>groovy-eclipse-compiler</artifactId>
                        <version>2.8.0-01</version>
                    </dependency>
                    <dependency>
                        <groupId>org.codehaus.groovy</groupId>
                        <artifactId>groovy-eclipse-batch</artifactId>
                        <version>2.1.5-03</version>
                    </dependency>
                </dependencies>
            </plugin>

When I'm trying to compiling this snipper of code below, I can see groovy compiler fails to compile but I

package com.josselin.groovy.webapp.application

import org.glassfish.jersey.server.ResourceConfig

/**
 * Created with IntelliJ IDEA.
 * User: Josselin
 * Date: 01.09.13
 * Time: 18:16
 * To change this template use File | Settings | File Templates.
 */

class MyApplication extends ResourceConfig {

}

maven fails without any clear explanation. The interesting thing is if I try to switch to groovy-eclipse-compiler 2.7.0-01 I have the following message 

Cannot override the final method from ResourceConfig

Any ideas ?
Reply | Threaded
Open this post in threaded view
|

Re: Strange behaviour with groovy-maven-eclipse 2.8.0-01

Andrew Eisenberg
Any chance you can provide the full pom file and I'll take a deeper look?  I can't really say what the problem is.  The class is not final according to the JavaDocs, so something is screwy.


On Sun, Sep 1, 2013 at 10:07 AM, Josselin Lebret <[hidden email]> wrote:
Hi everyone

I'm trying to build a simple groovy webapp with Jersey 2 API using the groovy eclipse compiler maven plugin . Note that I am note using the eclipse plugin but only command line maven (I'm using maven 3.1.0 on windows)

Here's the extract from my POM about the compiler settings

<plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.0</version>
                <configuration>
                    <compilerId>groovy-eclipse-compiler</compilerId>
                    <verbose>true</verbose>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>org.codehaus.groovy</groupId>
                        <artifactId>groovy-eclipse-compiler</artifactId>
                        <version>2.8.0-01</version>
                    </dependency>
                    <dependency>
                        <groupId>org.codehaus.groovy</groupId>
                        <artifactId>groovy-eclipse-batch</artifactId>
                        <version>2.1.5-03</version>
                    </dependency>
                </dependencies>
            </plugin>

When I'm trying to compiling this snipper of code below, I can see groovy compiler fails to compile but I

package com.josselin.groovy.webapp.application

import org.glassfish.jersey.server.ResourceConfig

/**
 * Created with IntelliJ IDEA.
 * User: Josselin
 * Date: 01.09.13
 * Time: 18:16
 * To change this template use File | Settings | File Templates.
 */

class MyApplication extends ResourceConfig {

}

maven fails without any clear explanation. The interesting thing is if I try to switch to groovy-eclipse-compiler 2.7.0-01 I have the following message 

Cannot override the final method from ResourceConfig

Any ideas ?

Reply | Threaded
Open this post in threaded view
|

Re: Strange behaviour with groovy-maven-eclipse 2.8.0-01

Andrew Eisenberg

Oh wait...The RresourceConfig class defines getProperty and setProperty as final methods.  There is a conflict as these methods are declared by GroovyObject.  The compiler should be smart enough not to try to generate these methods, but for some reason it is failing.

I tried a simple example like this:

(Foo.java)
class Foo {
public final Object getProperty(String name) { return null; }
}

(Bar.groovy)
class Bar extends Foo { }

Joint compilation with groovyc worked with no problems.  So, it may be something about the groovy-eclipse-compiler.


On Sun, Sep 1, 2013 at 8:54 PM, Andrew Eisenberg <[hidden email]> wrote:
Any chance you can provide the full pom file and I'll take a deeper look?  I can't really say what the problem is.  The class is not final according to the JavaDocs, so something is screwy.


On Sun, Sep 1, 2013 at 10:07 AM, Josselin Lebret <[hidden email]> wrote:
Hi everyone

I'm trying to build a simple groovy webapp with Jersey 2 API using the groovy eclipse compiler maven plugin . Note that I am note using the eclipse plugin but only command line maven (I'm using maven 3.1.0 on windows)

Here's the extract from my POM about the compiler settings

<plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.0</version>
                <configuration>
                    <compilerId>groovy-eclipse-compiler</compilerId>
                    <verbose>true</verbose>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>org.codehaus.groovy</groupId>
                        <artifactId>groovy-eclipse-compiler</artifactId>
                        <version>2.8.0-01</version>
                    </dependency>
                    <dependency>
                        <groupId>org.codehaus.groovy</groupId>
                        <artifactId>groovy-eclipse-batch</artifactId>
                        <version>2.1.5-03</version>
                    </dependency>
                </dependencies>
            </plugin>

When I'm trying to compiling this snipper of code below, I can see groovy compiler fails to compile but I

package com.josselin.groovy.webapp.application

import org.glassfish.jersey.server.ResourceConfig

/**
 * Created with IntelliJ IDEA.
 * User: Josselin
 * Date: 01.09.13
 * Time: 18:16
 * To change this template use File | Settings | File Templates.
 */

class MyApplication extends ResourceConfig {

}

maven fails without any clear explanation. The interesting thing is if I try to switch to groovy-eclipse-compiler 2.7.0-01 I have the following message 

Cannot override the final method from ResourceConfig

Any ideas ?


Reply | Threaded
Open this post in threaded view
|

Re: Strange behaviour with groovy-maven-eclipse 2.8.0-01

Josselin Lebret
Thanks for your feedback!

should we create a JIRA for this bug ?


2013/9/2 Andrew Eisenberg <[hidden email]>

Oh wait...The RresourceConfig class defines getProperty and setProperty as final methods.  There is a conflict as these methods are declared by GroovyObject.  The compiler should be smart enough not to try to generate these methods, but for some reason it is failing.

I tried a simple example like this:

(Foo.java)
class Foo {
public final Object getProperty(String name) { return null; }
}

(Bar.groovy)
class Bar extends Foo { }

Joint compilation with groovyc worked with no problems.  So, it may be something about the groovy-eclipse-compiler.



On Sun, Sep 1, 2013 at 8:54 PM, Andrew Eisenberg <[hidden email]> wrote:
Any chance you can provide the full pom file and I'll take a deeper look?  I can't really say what the problem is.  The class is not final according to the JavaDocs, so something is screwy.


On Sun, Sep 1, 2013 at 10:07 AM, Josselin Lebret <[hidden email]> wrote:
Hi everyone

I'm trying to build a simple groovy webapp with Jersey 2 API using the groovy eclipse compiler maven plugin . Note that I am note using the eclipse plugin but only command line maven (I'm using maven 3.1.0 on windows)

Here's the extract from my POM about the compiler settings

<plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.0</version>
                <configuration>
                    <compilerId>groovy-eclipse-compiler</compilerId>
                    <verbose>true</verbose>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>org.codehaus.groovy</groupId>
                        <artifactId>groovy-eclipse-compiler</artifactId>
                        <version>2.8.0-01</version>
                    </dependency>
                    <dependency>
                        <groupId>org.codehaus.groovy</groupId>
                        <artifactId>groovy-eclipse-batch</artifactId>
                        <version>2.1.5-03</version>
                    </dependency>
                </dependencies>
            </plugin>

When I'm trying to compiling this snipper of code below, I can see groovy compiler fails to compile but I

package com.josselin.groovy.webapp.application

import org.glassfish.jersey.server.ResourceConfig

/**
 * Created with IntelliJ IDEA.
 * User: Josselin
 * Date: 01.09.13
 * Time: 18:16
 * To change this template use File | Settings | File Templates.
 */

class MyApplication extends ResourceConfig {

}

maven fails without any clear explanation. The interesting thing is if I try to switch to groovy-eclipse-compiler 2.7.0-01 I have the following message 

Cannot override the final method from ResourceConfig

Any ideas ?



Reply | Threaded
Open this post in threaded view
|

Re: Strange behaviour with groovy-maven-eclipse 2.8.0-01

Andrew Eisenberg
Sure. You can raise an issue for it.  We'll try to get someone to look at it.


On Sun, Sep 8, 2013 at 2:15 AM, Josselin Lebret <[hidden email]> wrote:
Thanks for your feedback!

should we create a JIRA for this bug ?


2013/9/2 Andrew Eisenberg <[hidden email]>

Oh wait...The RresourceConfig class defines getProperty and setProperty as final methods.  There is a conflict as these methods are declared by GroovyObject.  The compiler should be smart enough not to try to generate these methods, but for some reason it is failing.

I tried a simple example like this:

(Foo.java)
class Foo {
public final Object getProperty(String name) { return null; }
}

(Bar.groovy)
class Bar extends Foo { }

Joint compilation with groovyc worked with no problems.  So, it may be something about the groovy-eclipse-compiler.



On Sun, Sep 1, 2013 at 8:54 PM, Andrew Eisenberg <[hidden email]> wrote:
Any chance you can provide the full pom file and I'll take a deeper look?  I can't really say what the problem is.  The class is not final according to the JavaDocs, so something is screwy.


On Sun, Sep 1, 2013 at 10:07 AM, Josselin Lebret <[hidden email]> wrote:
Hi everyone

I'm trying to build a simple groovy webapp with Jersey 2 API using the groovy eclipse compiler maven plugin . Note that I am note using the eclipse plugin but only command line maven (I'm using maven 3.1.0 on windows)

Here's the extract from my POM about the compiler settings

<plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.0</version>
                <configuration>
                    <compilerId>groovy-eclipse-compiler</compilerId>
                    <verbose>true</verbose>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>org.codehaus.groovy</groupId>
                        <artifactId>groovy-eclipse-compiler</artifactId>
                        <version>2.8.0-01</version>
                    </dependency>
                    <dependency>
                        <groupId>org.codehaus.groovy</groupId>
                        <artifactId>groovy-eclipse-batch</artifactId>
                        <version>2.1.5-03</version>
                    </dependency>
                </dependencies>
            </plugin>

When I'm trying to compiling this snipper of code below, I can see groovy compiler fails to compile but I

package com.josselin.groovy.webapp.application

import org.glassfish.jersey.server.ResourceConfig

/**
 * Created with IntelliJ IDEA.
 * User: Josselin
 * Date: 01.09.13
 * Time: 18:16
 * To change this template use File | Settings | File Templates.
 */

class MyApplication extends ResourceConfig {

}

maven fails without any clear explanation. The interesting thing is if I try to switch to groovy-eclipse-compiler 2.7.0-01 I have the following message 

Cannot override the final method from ResourceConfig

Any ideas ?