gmaven plus 1.5 and groovy-all:2.4.6:indy

475 views
Skip to first unread message

Michael Kohout

unread,
Feb 26, 2016, 3:57:53 PM2/26/16
to GMavenPlus
Hi-

I have an app I'm targeting for jre8 along with invokedynamic but we're having problems using groovy 2.4.5/2.4.6(or any version but 2.4.1) along with indy/invokedynamic.

here are the relevant part of our pom:
<dependency>
    <groupId>org.codehaus.groovy</groupId>
    <artifactId>groovy-all</artifactId>
    <version>2.4.6</version>
    <classifier>indy</classifier>
    <exclusions>
        <exclusion>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
        </exclusion>
    </exclusions>
</dependency>

<plugin>
                    <groupId>org.codehaus.gmavenplus</groupId>
                    <artifactId>gmavenplus-plugin</artifactId>
                    <version>1.5</version>
                    <executions>
                        <execution>
                            <goals>
                                <!-- we're only doing groovy-only compilation.  if .java files are ever included this will have to be altered:
                                    https://github.com/groovy/GMavenPlus/wiki/Examples#pure-groovy-compilation    -->
                                <goal>addSources</goal>
                                <goal>addTestSources</goal>
                                <goal>compile</goal>
                                <goal>testCompile</goal>
                            </goals>
                        </execution>
                    </executions>
                    <configuration>
                        <invokeDynamic>true</invokeDynamic>
                    </configuration>
 </plugin>
whenever I try to execute tests, I'm getting the following error:


[ERROR] Failed to execute goal org.codehaus.gmavenplus:gmavenplus-plugin:1.5:testCompile (default) on project pricing-services-common: Execution default of goal org.codehaus.gmavenplus:gmavenplus-plugin:1.5:testCompile failed: An API incompatibility was encountered while executing org.codehaus.gmavenplus:gmavenplus-plugin:1.5:testCompile: java.lang.ExceptionInInitializerError: null

[ERROR] -----------------------------------------------------

.

.(a bunch of other lines)

.

[ERROR] Number of foreign imports: 1

[ERROR] import: Entry[import  from realm ClassRealm[maven.api, parent: null]]

[ERROR] 

[ERROR] -----------------------------------------------------: Conflicting module versions. Module [groovy-all is loaded in version 2.4.6 and you are trying to load version 2.4.1

[ERROR] -> [Help 1]



If I leave off invokedynamic/indy, everything works great.  If I have invokedynamic/indy, but compile against groovy 2.4.1 it works great.  


Is there any way to use groovy 2.4.5 or 2.4.6 and invokedynamic/indy with gmaven 1.5?


thanks for the help


Keegan Witt

unread,
Feb 27, 2016, 12:17:11 PM2/27/16
to Michael Kohout, GMavenPlus
I think what's happening is that you have a non-indy Groovy jar being pulled in as a dependency somewhere else (probably transitively).  Remember that classifiers are part of Maven's coordinates, just like the group ID and artifiact ID.  Maven won't know to choose the one with indy over the non-indy version (the only resolution it knows how to do is choose the newer version number).  So you have to make sure it gets excluded yourself.  Did you try doing a mvn dependency:tree -Dverbose and looking for where 2.4.1 non-indy is being pulled in?  Once you find which dependency has a dependency on the non-indy version, you should be able to just drop in an exclusion for it.

-Keegan

--
You received this message because you are subscribed to the Google Groups "GMavenPlus" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gmavenplus+...@googlegroups.com.
To post to this group, send email to gmave...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gmavenplus/47345026-a493-424a-a657-2633f0670c70%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Michael Kohout

unread,
Feb 29, 2016, 1:36:56 PM2/29/16
to GMavenPlus, mwko...@gmail.com
The only dependency I have that refers to groovy 2.4.1 is gmaven-plus itself.

Michael Kohout

unread,
Feb 29, 2016, 2:04:24 PM2/29/16
to GMavenPlus, mwko...@gmail.com
Doh!  I was wrong.  Spock was the issue.  As soon as I excluded the groovy-all referenced in spock, I was good.

Thanks for the help!

Keegan Witt

unread,
Mar 1, 2016, 11:13:02 PM3/1/16
to Michael Kohout, GMavenPlus
No problem.  Glad you got it sorted out!

-Keegan

Reply all
Reply to author
Forward
0 new messages