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

BUG: Including org.grails.grails-gsp should automatically configure gsp compilation for web apps. #234

Open
codeconsole opened this issue Oct 19, 2023 · 8 comments

Comments

@codeconsole
Copy link
Contributor

As of Grails 6.0.0, it is now required to add the following to an apps build.gradle

tasks.withType(War).configureEach { War war ->
    war.dependsOn compileGroovyPages
}

This should be configured automatically by the plugin. Previous versions of grails did not require this and the mention of the required addition was not added to the release announcement or release notes for 6.0.0

@matthijsbierman
Copy link

matthijsbierman commented Oct 19, 2023

With Grails 6.0.0 installed through SDKman, I see that snippet in build.gradle after running:

grails create-app com.example.app

Using https://start.grails.org/ it also shows the required snippet.

@codeconsole
Copy link
Contributor Author

@matthijsbierman that snippet shouldn’t be necessary and the plugin should automatically configure that behavior

@matthijsbierman
Copy link

@codeconsole I see what you mean. Agreed, it would be best if the plugin itself configures it.

@puneetbehl
Copy link
Contributor

This is already in place at https://github.com/grails/grails-gradle-plugin/blob/6.1.x/src/main/groovy/org/grails/gradle/plugin/web/gsp/GroovyPagePlugin.groovy#L87

Could you please verify if it still works after removing it from the build.gradle for Grails 6.1.0-SNAPSHOT?

@codeconsole
Copy link
Contributor Author

Sure, I will check

@codeconsole
Copy link
Contributor Author

@puneetbehl

I can confirm that the following is no longer needed:

tasks.withType(War).configureEach { War war ->
    war.dependsOn compileGroovyPages
}

I did notice one other thing. It seems like the source gsp pages are also included. Is this expected behavior?

     3204  10-25-2023 17:37   WEB-INF/classes/layouts/main.gsp
     2538  10-25-2023 17:37   WEB-INF/classes/sample/edit.gsp
     2191  10-25-2023 17:37   WEB-INF/classes/sample/show.gsp
     2329  10-25-2023 17:37   WEB-INF/classes/sample/create.gsp
     1701  10-25-2023 17:37   WEB-INF/classes/sample/index.gsp
     3880  10-25-2023 17:37   WEB-INF/classes/index.gsp

Also, has the code block been removed from the results of grails create-app ?
I am not sure where to check for that. How is the base build.gradle generated? Where is base source code for that?

@puneetbehl
Copy link
Contributor

@codeconsole
Copy link
Contributor Author

     3204  10-25-2023 17:37   WEB-INF/classes/layouts/main.gsp
     2538  10-25-2023 17:37   WEB-INF/classes/sample/edit.gsp
     2191  10-25-2023 17:37   WEB-INF/classes/sample/show.gsp
     2329  10-25-2023 17:37   WEB-INF/classes/sample/create.gsp
     1701  10-25-2023 17:37   WEB-INF/classes/sample/index.gsp
     3880  10-25-2023 17:37   WEB-INF/classes/index.gsp

I did notice one other thing. It seems like the source gsp pages are also included. Is this expected behavior?

@puneetbehl ?

matrei added a commit to matrei/grails-forge that referenced this issue Jan 16, 2024
This configuration is now done by the grails-gradle-plugin.

Related: grails/grails-gradle-plugin#234
puneetbehl pushed a commit to grails/grails-forge that referenced this issue Jan 28, 2024
This configuration is now done by the grails-gradle-plugin.

Related: grails/grails-gradle-plugin#234
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

No branches or pull requests

3 participants