Skip to content

Remove the vestigial gspCompile configuration - #16088

Merged
jdaugherty merged 1 commit into
apache:8.0.xfrom
codeconsole:refactor/remove-gspcompile-configuration
Aug 3, 2026
Merged

jdaugherty merged 1 commit into
apache:8.0.xfrom
codeconsole:refactor/remove-gspcompile-configuration

Conversation

@codeconsole

Copy link
Copy Markdown
Contributor

Follow-up to #16068. In that PR @matrei noted:

We should also add a comment in the GroovyPagePlugin where we are registering the gspCompile configuration, that it is an extension point for applications to add compile dependencies for GSP compilation. I can't think of a use case for that right now, and if there is no use case, we could remove the gspCompile configuration all together.

There is no use case. This removes it.

Where it came from

gspCompile was introduced in 2014 (42c739f) as the classpath for the original Ant-based GSP compiler, which ran through IsolatedAntBuilder:

antBuilder.withClasspath(project.configurations.gspCompile).execute {
    taskdef(name: 'gspc', classname: 'org.grails.web.pages.GroovyPageCompilerTask')
    ...
}

It held the two artifacts that compiler needed — grails-web-gsp and the servlet API. It was never an extension point; it was the compiler's own toolchain classpath.

When GSP compilation moved to the forked GroovyPageForkCompileTask — classpath compileClasspath + gspCompile + compiled classes + providedCompile — the grails-web-gsp entry was dropped and only the servlet API line survived. #16068 removed that line, which leaves a configuration that is empty in every build and contributes no files to the GSP compile classpath.

What still supplies the classpath

GSPs compile against compileClasspath, the project's compiled classes, and providedCompile for a WAR build. That is what actually supplies everything GSP compilation needs, and it is unchanged here.

Behavior break

A build that declares dependencies on gspCompile now fails with Could not find method gspCompile(). The migration is compileOnly, which lands on the same compile classpath the GSP compiler reads:

dependencies {
    // Grails 7
    // gspCompile 'com.example:some-library:1.0'

    // Grails 8
    compileOnly 'com.example:some-library:1.0'
}

Documented as section 41 of the Grails 8 upgrade guide.

Tests

Adds GroovyPagePluginFunctionalSpec, a TestKit spec that applies org.apache.grails.gradle.grails-gsp to a project and asserts the configuration is gone while compileGroovyPages and compileWebappGroovyPages still resolve the compile classpath, provided dependencies and compiled classes. The classpath assertions use marker directories as file dependencies, so nothing is resolved from a repository. The first assertion was verified to fail when the configuration is restored.

Verified with :grails-gradle-plugins:test --rerun-tasks (90 tests), :grails-gradle-plugins:check, aggregateViolations (Checkstyle, CodeNarc, PMD, SpotBugs all clean) and :grails-doc:publishGuide.

Follow-up to apache#16068, which removed the hardcoded servlet API dependency
that gspCompile carried.

The configuration was introduced in 2014 as the classpath for the
original Ant-based GSP compiler, which ran via IsolatedAntBuilder:

    antBuilder.withClasspath(project.configurations.gspCompile)

It held the two artifacts that compiler needed - grails-web-gsp and the
servlet API. When GSP compilation moved to the forked
GroovyPageForkCompileTask, whose classpath is compileClasspath +
gspCompile + compiled classes + providedCompile, the grails-web-gsp entry
was dropped and only the servlet API line remained. apache#16068 removed that,
leaving a configuration that is empty for every build and contributes no
files to the GSP compile classpath.

GSPs continue to compile against compileClasspath, the project's compiled
classes and providedCompile, which is what actually supplies everything
GSP compilation needs.

This is a behavior break for any build that declares dependencies on
gspCompile: those fail with "Could not find method gspCompile()".
Documented in the Grails 8 upgrade guide with the migration to
compileOnly, which lands on the same compile classpath.

Adds GroovyPagePluginFunctionalSpec, a TestKit spec that applies
org.apache.grails.gradle.grails-gsp and asserts the configuration is gone
while compileGroovyPages and compileWebappGroovyPages still resolve the
compile classpath, provided dependencies and compiled classes. Verified
the first assertion fails when the configuration is restored.

Verified with :grails-gradle-plugins:test --rerun-tasks (90 tests),
:grails-gradle-plugins:check, aggregateViolations (Checkstyle, CodeNarc,
PMD, SpotBugs all clean) and :grails-doc:publishGuide.
@codecov

codecov Bot commented Aug 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 51.9701%. Comparing base (063ca52) to head (80bf683).

Additional details and impacted files

Impacted file tree graph

@@                Coverage Diff                 @@
##                8.0.x     #16088        +/-   ##
==================================================
- Coverage     51.9837%   51.9701%   -0.0135%     
+ Complexity      18036      18029         -7     
==================================================
  Files            2038       2038                
  Lines           95707      95705         -2     
  Branches        16648      16648                
==================================================
- Hits            49752      49738        -14     
- Misses          38619      38628         +9     
- Partials         7336       7339         +3     
Files with missing lines Coverage Δ
...ls/gradle/plugin/views/gsp/GroovyPagePlugin.groovy 0.0000% <ø> (ø)

... and 4 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@testlens-app

testlens-app Bot commented Aug 3, 2026

Copy link
Copy Markdown

✅ All tests passed ✅

🏷️ Commit: 80bf683
▶️ Tests: 57744 executed
⚪️ Checks: 60/60 completed


Learn more about TestLens at testlens.app.

@codeconsole
codeconsole requested review from jdaugherty, matrei and sbglasius and removed request for jdaugherty August 3, 2026 03:09
@jdaugherty
jdaugherty merged commit 3603e69 into apache:8.0.x Aug 3, 2026
63 checks passed
@jdaugherty
jdaugherty deleted the refactor/remove-gspcompile-configuration branch August 3, 2026 14:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants