Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gradle 8 compatability: compileWebappGroovyPages depends on copyAstClasses #331

Merged
merged 1 commit into from
Sep 17, 2024

Conversation

codeconsole
Copy link
Contributor

No description provided.

@codeconsole codeconsole merged commit 33ac8ec into grails:7.0.x Sep 17, 2024
6 checks passed
@codeconsole
Copy link
Contributor Author

@jamesfredley this is breaking

org.gradle.api.plugins.InvalidPluginException: An exception occurred applying plugin request [id: 'org.grails.grails-gsp', version: '7.0.0-SNAPSHOT']
    at org.gradle.plugin.use.internal.DefaultPluginRequestApplicator.exceptionOccurred(DefaultPluginRequestApplicator.java:179)

An exception occurred applying plugin request [id: 'org.grails.grails-gsp', version: '7.0.0-SNAPSHOT']
> Failed to apply plugin 'org.grails.grails-gsp'.
   > Cannot read the array length because "<local2>" is null

but adding this directly in the app build.gradle fixes

compileWebappGroovyPages.dependsOn(copyAstClasses)
* What went wrong:
A problem was found with the configuration of task ':compileWebappGroovyPages' (type 'GroovyPageForkCompileTask').
  - Gradle detected a problem with the following location: '/Users/sheiberg/Documents/workspace/grails-plugin-sitemesh3/build/classes/groovy/main'.
    
    Reason: Task ':compileWebappGroovyPages' uses this output of task ':copyAstClasses' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed.
    
    Possible solutions:
      1. Declare task ':copyAstClasses' as an input of ':compileWebappGroovyPages'.
      2. Declare an explicit dependency on ':copyAstClasses' from ':compileWebappGroovyPages' using Task#dependsOn.
      3. Declare an explicit dependency on ':copyAstClasses' from ':compileWebappGroovyPages' using Task#mustRunAfter.
    
    For more information, please refer to https://docs.gradle.org/8.10.1/userguide/validation_problems.html#implicit_dependency in the Gradle documentation.

@matrei you have any thoughts on what causes the above exception and how to fix it directly in the plugin?

@jamesfredley
Copy link
Contributor

@codeconsole give #332 a try. This one was more complicated than normal since the two tasks did not always exist at the same time and required a try/catch.

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.

2 participants