spacer
  • GMaven
  • GMAVEN-86

Gmaven compile error when using with groovy 1.7.7 and 1.7.8

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: spacer Bug
  • Status: spacer Closed
  • Priority: spacer Critical
  • Resolution: Not A Bug
  • Affects Version/s: 1.3
  • Fix Version/s: None
  • Component/s: compile
  • Labels:
    None
  • Environment:
    Maven 3.0.2, Linux 2.6.32-28-generic i686 GNU/Linux
  • Testcase included:
    yes
  • Number of attachments :
    2

Description

Hi,

the gmaven plugin could not compile groovy sources if used with groovy 1.7.7 or 1.7.8. All other versions are working fine.

When you run mvn compile on the example project attached the following error is thrown:

[ERROR] Failed to execute goal org.codehaus.gmaven:gmaven-plugin:1.3:compile (default) on project GMavenTest: Execution default of goal org.codehaus.gmaven:gmaven-plugin:1.3:compile failed: An API incompatibility was encountered while executing org.codehaus.gmaven:gmaven-plugin:1.3:compile: java.lang.NoSuchMethodError: org.codehaus.groovy.control.SourceUnit.getSource()Lorg/codehaus/groovy/control/io/ReaderSource;

The full stacktrace is attached.

  • Options
    • Sort By Name
    • Sort By Date
    • Ascending
    • Descending
    • Download All

Attachments

  1. spacer
    GMavenTest.tar.gz
    18/Feb/11 2:47 AM
    7 kB
    Marcel Szalbach
  2. spacer
    stackTrace.txt
    18/Feb/11 2:47 AM
    22 kB
    Marcel Szalbach

Activity

Ascending order - Click to sort in descending order
    All Comments Work Log History Activity
Hide
Permalink
Albert Kurucz added a comment -

similar error when trying to compile 1.8.0-rc-1 :

Execution default of goal org.codehaus.gmaven:gmaven-plugin:1.3:compile failed: An API incompatibility was encountered while executing org.codehaus.gmaven:gmaven-plugin:1.3:compile: java.lang.NoSuchMethodError: org.codehaus.groovy.control.SourceUnit.getSource()Lorg/codehaus/groovy/control/io/ReaderSource;

Show
Albert Kurucz added a comment - similar error when trying to compile 1.8.0-rc-1 : Execution default of goal org.codehaus.gmaven:gmaven-plugin:1.3:compile failed: An API incompatibility was encountered while executing org.codehaus.gmaven:gmaven-plugin:1.3:compile: java.lang.NoSuchMethodError: org.codehaus.groovy.control.SourceUnit.getSource()Lorg/codehaus/groovy/control/io/ReaderSource;
Hide
Permalink
Marcel Szalbach added a comment - - edited

I found the solution or workaround(this plugin really needs a better documentation) for this problem with the new groovy version you need to add the groovy-runtime to the plugin dependencies. After this change I can also build groovy 1.8 modules.

<plugin>
    <groupId>org.codehaus.gmaven</groupId>
    <artifactId>gmaven-plugin</artifactId>
    <version>${gmaven.version}</version>
    <dependencies>
        <dependency>
            <groupId>org.codehaus.gmaven.runtime</groupId>
            <artifactId>gmaven-runtime-1.7</artifactId>
            <version>${gmaven.version}</version>
        </dependency>
    </dependencies>
    <executions>
        <execution>
            <goals>
                <goal>compile</goal>
                <goal>testCompile</goal>
            </goals>
        </execution>
    </executions>
</plugin>
Show
Marcel Szalbach added a comment - - edited I found the solution or workaround(this plugin really needs a better documentation) for this problem with the new groovy version you need to add the groovy-runtime to the plugin dependencies. After this change I can also build groovy 1.8 modules.
<plugin>
    <groupId>org.codehaus.gmaven</groupId>
    <artifactId>gmaven-plugin</artifactId>
    <version>${gmaven.version}</version>
    <dependencies>
        <dependency>
            <groupId>org.codehaus.gmaven.runtime</groupId>
            <artifactId>gmaven-runtime-1.7</artifactId>
            <version>${gmaven.version}</version>
        </dependency>
    </dependencies>
    <executions>
        <execution>
            <goals>
                <goal>compile</goal>
                <goal>testCompile</goal>
            </goals>
        </execution>
    </executions>
</plugin>
Hide
Permalink
Travis Webb added a comment -

I am also seeing this issue with Groovy 1.8.6, Maven 3.0.4, and GMaven 1.4

Show
Travis Webb added a comment - I am also seeing this issue with Groovy 1.8.6, Maven 3.0.4, and GMaven 1.4
Hide
Permalink
Clemens Fuchslocher added a comment -

I published a project on GitHub which demonstrates the usage of the gmaven-plugin: https://github.com/vakuum/polyglot-java.

$ git clone https://github.com/vakuum/polyglot-java.git
$ cd polyglot-java
$ mvn clean install -DskipTests
$ mvn exec:java --projects groovy
$ cat all/src/main/java/polyglot/All.java
$ mvn exec:java --projects all

Maybe helpful.

Show
Clemens Fuchslocher added a comment - I published a project on GitHub which demonstrates the usage of the gmaven-plugin: https://github.com/vakuum/polyglot-java.
$ git clone https://github.com/vakuum/polyglot-java.git
$ cd polyglot-java
$ mvn clean install -DskipTests
$ mvn exec:java --projects groovy
$ cat all/src/main/java/polyglot/All.java
$ mvn exec:java --projects all
Maybe helpful.
Hide
Permalink
Keegan Witt added a comment - - edited

The workaround is no longer needed now that 1.4 supports 1.8. I'm sorry that wasn't better documented at the time. I believe you'll find if you add

<properties>
    <gmavenProviderSelection>1.7</gmavenProviderSelection>
    ...
</properties>
<plugin>
    <groupId>org.codehaus.gmaven</groupId>
    <artifactId>gmaven-plugin</artifactId>
    ...
    <configuration>
        <providerSelection>${gmavenProviderSelection}</providerSelection>
    </configuration>
</plugin>

It'll work just fine (it did for me anyway). You can do this instead of adding the gmaven-runtime dependency. Once I get done wrapping up a few things for the next release, I'll try to update the documentation to reflect this. If it doesn't work for some reason, leave a comment and I'll reopen.

Show
Keegan Witt added a comment - - edited The workaround is no longer needed now that 1.4 supports 1.8. I'm sorry that wasn't better documented at the time. I believe you'll find if you add
<properties>
    <gmavenProviderSelection>1.7</gmavenProviderSelection>
    ...
</properties>
<plugin>
    <groupId>org.codehaus.gmaven</groupId>
    <artifactId>gmaven-plugin</artifactId>
    ...
    <configuration>
        <providerSelection>${gmavenProviderSelection}</providerSelection>
    </configuration>
</plugin>
It'll work just fine (it did for me anyway). You can do this instead of adding the gmaven-runtime dependency. Once I get done wrapping up a few things for the next release, I'll try to update the documentation to reflect this. If it doesn't work for some reason, leave a comment and I'll reopen.
Hide
Permalink
Marcel Szalbach added a comment -

I have tested it and it works as expected. Thanks for the fix.

Show
Marcel Szalbach added a comment - I have tested it and it works as expected. Thanks for the fix.

People

  • Assignee:
    Keegan Witt
    Reporter:
    Marcel Szalbach
Vote (5)
Watch (5)

Dates

  • Created:
    Updated:
    Resolved: