Skip to content

feat: Support toolchains for compilation, GroovyDoc, and stub generation#349

Merged
keeganwitt merged 2 commits intomasterfrom
toolchain
Jan 14, 2026
Merged

feat: Support toolchains for compilation, GroovyDoc, and stub generation#349
keeganwitt merged 2 commits intomasterfrom
toolchain

Conversation

@keeganwitt
Copy link
Copy Markdown
Member

@keeganwitt keeganwitt commented Jan 11, 2026

Closes #43

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds support for Maven toolchains to enable forked execution of Groovy compilation, stub generation, and GroovyDoc generation. This allows users to compile with different JDK versions than the one running Maven.

Changes:

  • Extracted compilation logic into new GroovyCompiler and ForkedGroovyCompiler classes to support both in-process and forked execution
  • Added toolchain manager integration to AbstractCompileMojo, AbstractGenerateStubsMojo, and AbstractGroovyDocMojo
  • Created configuration model classes (GroovyCompileConfiguration, GroovyStubConfiguration, GroovyDocConfiguration) for serializing compilation settings to forked processes
  • Added integration tests for forked compilation, stub generation, and GroovyDoc

Reviewed changes

Copilot reviewed 31 out of 32 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/main/java/org/codehaus/gmavenplus/util/GroovyCompiler.java New utility class containing refactored compilation logic supporting both in-process and forked execution
src/main/java/org/codehaus/gmavenplus/util/ForkedGroovyCompiler.java New main class for forked process execution
src/main/java/org/codehaus/gmavenplus/mojo/AbstractCompileMojo.java Refactored to use GroovyCompiler and support toolchains
src/main/java/org/codehaus/gmavenplus/mojo/AbstractGenerateStubsMojo.java Refactored to use GroovyCompiler and support toolchains
src/main/java/org/codehaus/gmavenplus/mojo/AbstractGroovyDocMojo.java Refactored to use GroovyCompiler and support toolchains
src/main/java/org/codehaus/gmavenplus/model/* New configuration classes for serializing compilation settings
src/test/java/org/codehaus/gmavenplus/util/GroovyCompilerTest.java New test class for GroovyCompiler
src/it/forked* Integration tests for forked execution

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@keeganwitt keeganwitt merged commit d37ef0a into master Jan 14, 2026
5 checks passed
@keeganwitt keeganwitt deleted the toolchain branch January 14, 2026 18:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support maven-toolchains-plugin

2 participants