Incremental compile doesn't seem to work

5 views
Skip to first unread message

Don Noit

unread,
Feb 4, 2026, 6:32:35 PMFeb 4
to GMavenPlus
I'm using GMavenplus 3.0.2 with maven-compiler-plugin to compile in a project with both Groovy and Java code.  

Even if there are no code changes, I always see the same output during the ocmpile phase:

[INFO] --- gmavenplus-plugin:3.0.2:compile (default) @ z-api ---
[INFO] Using isolated classloader, without GMavenPlus classpath.
[INFO] Using Groovy 4.0.22 to perform compile.
[INFO] invokedynamic enabled.
[INFO] Parallel parsing enabled.
[INFO] Compiled 4159 files.

I'm wondering: Does GMavenPlus not support incremental compiles, or am I missing something obvious? Would appreciate any pointers.

Excerpt from my POM.xml:
<plugin>
 <groupId>org.apache.maven.plugins</groupId>
 <artifactId>maven-compiler-plugin</artifactId>
 <version>3.11.0</version>
 <configuration>
  <useIncrementalCompilation>true</useIncrementalCompilation>
  <source>17</source>
  <target>17</target>
 </configuration>
</plugin>
<plugin>
  <groupId>org.codehaus.gmavenplus</groupId>
  <artifactId>gmavenplus-plugin</artifactId>
  <version>3.0.2</version>
  <configuration>
  <targetBytecode>17</targetBytecode>
  <jvmArgs>
  <jvmArg>--add-opens</jvmArg>
  <jvmArg>java.base/java.lang=ALL-UNNAMED</jvmArg>
  </jvmArgs>
  </configuration>
<executions>
  <execution>
   <goals>
   <goal>addSources</goal>
   <goal>addTestSources</goal>
   <goal>compile</goal>
   <goal>compileTests</goal>
  </goals>
  </execution>
</executions>
</plugin>

Keegan Witt

unread,
Feb 20, 2026, 6:18:19 PM (8 days ago) Feb 20
to Don Noit, GMavenPlus
The plugin resets the modification date on the generated stubs, causing the Maven Compiler Plugin to see them as updated sources. This logic was copied from the original GMaven plugin, which implemented it to mitigate MGROOVY-187, which was the Maven Compiler Plugin overwriting classes compiled by groovyc. This breaks things because the stubs lack the full class implementations. As the name suggests, they are just stubs. I created https://github.com/groovy/GMavenPlus/issues/141 a long while back to try to come up with a way to support incremental compilation. But it's a problem I haven't yet solved.

So unfortunately, for the time being, this is expected behavior.

-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 view this discussion visit https://groups.google.com/d/msgid/gmavenplus/f708a3b0-8f09-41f5-95be-1b8cbcbc957fn%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages