Groovy unit tests always recompiled by GMavenPlus plugin

193 views
Skip to first unread message

Jan Peremsky

unread,
Aug 1, 2019, 10:40:53 AM8/1/19
to GMavenPlus
Hi, 
in my maven based project with mixed test sources (java + groovy) at each build all the groovy based tests are recompiled again and again.
While as java sources recompilation is skipped - if there are no changes - groovy sources are always considered eligible for recompilation and recompiled each time mvn build is executed :-(

Is it a feature or bug?

Is there a way of how to configure maven-compiler-plugin together with gmavenplus-plugin to detect there are no changes?

I'm using java 12 to compile java sources. (but used to use java 8 and 11 with the same behaviour)
I'm using groovy 2.5.7 to compile my sources.

An excerpt from my pom can be seen below.

Thanks Jan




<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<useIncrementalCompilation>true</useIncrementalCompilation>
<parameters>true</parameters>
<compilerArgs>
<arg>-Xpkginfo:always</arg>
</compilerArgs>
</configuration>
<dependencies>
<dependency>
<groupId>org.ow2.asm</groupId>
<artifactId>asm</artifactId>
<version>7.1</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>org.codehaus.gmavenplus</groupId>
<artifactId>gmavenplus-plugin</artifactId>
<version>1.7.1</version>
<executions>
<execution>
<goals>
<goal>addTestSources</goal>
<goal>compileTests</goal>
</goals>
</execution>
</executions>
<configuration>
<invokeDynamic>true</invokeDynamic>
<testSources>
<testSource>
<directory>${project.basedir}/src/test/java</directory>
<includes>
<include>**/*.groovy</include>
</includes>
</testSource>
</testSources>
</configuration>
<dependencies>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-all</artifactId>
<version>${groovy.version}</version>
<type>pom</type>
</dependency>

</dependencies>
</plugin>

Keegan Witt

unread,
Aug 5, 2019, 1:08:28 AM8/5/19
to GMavenPlus
It's been a while since I've looked at what work has done on incremental compilation.  I'll need to do some more research before I can provide a complete answer.  I know there used to be a number of issues preventing this from working correctly, which is part of why I hadn't pursued it in the past.  But I'm uncertain whether these issues are still obstacles or not...

-Keegan
Reply all
Reply to author
Forward
0 new messages