trying to solve the follwoing error when upgrading...
# questions
d
trying to solve the follwoing error when upgrading to grails 7 A problem occurred evaluating project ':wt-app'.
Plugin with id 'org.apache.grails:grails-gsp' not found.
u
This error means the Gradle plugin id is incorrect. For Grails 7, the correct plugin id is org.apache.grails.grails-gsp (with dots, not colons). Update your build.gradle to use:
Copy code
plugins {
    id "org.apache.grails.grails-gsp"
}
According to the official docs, Grails 7 plugins use dot notation for Gradle plugin ids, and all dependencies must use the new org.apache.grails group and updated coordinates. See more at Grails 7 Upgrading Guide. Would you like more detail on updating other dependencies or plugins? Sources: - https://docs.grails.org/latest/guide/theWebLayer.html#gsp - https://grails.apache.org/docs/latest/guide/theWebLayer.html#gsp 👍 0 button 👎 2 button 💡 Hint: Mention @User in the thread for followups.
u
A message from kapa.ai
u
New message text here
u
An alternative approach to resolving the issue is to ensure that the
grails-gsp
plugin is applied correctly using the
apply plugin
syntax instead of the
plugins
block. This can be particularly useful if your project is using an older Gradle configuration style or if you encounter compatibility issues with the
plugins
block. You can update your
build.gradle
file as follows:
Copy code
apply plugin: "org.apache.grails.grails-gsp"
This method explicitly applies the
grails-gsp
plugin and can help avoid potential issues with plugin resolution. Additionally, ensure that the
grails-gsp
dependency is included in your
dependencies
block:
Copy code
dependencies {
    implementation "org.apache.grails:grails-gsp:7.0.0-RC2"
}
According to the Grails Web Layer Documentation, the
grails-gsp
plugin must be correctly applied and the dependency must be included for GSP functionality to work in Grails 7. This approach provides flexibility and ensures compatibility with older Gradle configurations. Would you like assistance verifying other dependencies or Gradle configurations in your project? Sources: - https://docs.grails.org/latest/guide/theWebLayer.html#gsp - https://grails.apache.org/docs/latest/guide/theWebLayer.html#gsp 👍 0 button 👎 3 button 💡 Hint: Mention @User in the thread for followups.
j
We do not publish our gradle plugins to the portal. Have you made sure you're reference maven central in your buildScript or buildsrc?
d
yea i have mavenCentral() any place i have a repo
j
are you using buildSrc or buildscript?
d
buildscript
pipepiep
j
Are you including
org.apache.grails:grails-gradle-plugins
on the classpath for gradle in buildscript?
d
Copy code
dependencies {
        classpath "org.apache.grails:grails-gradle-plugins:7.0.0-RC2"
        classpath platform("org.apache.grails:grails-bom:$grailsVersion")
    }
j
drop the :7.0.0-RC2 - by using the bom, you don't need it.
but if it's really in your build script then it should be found.
d
Copy code
gradle-8.11.1
is ok?
j
that shouldn't matter. I'm assuming you have a multiproject build?
oh, nevermind, I see the issue. The grails-gsp package coordinates are what you listed, butthe gradle plugin name is 'org.apache.grails.gradle.grails-gsp'
going forward all of our gradle plugins have an id of org.apache.grails.gradle.*
d
thank you!!! that link will be super useful
its always a typo isnt it
👍 1
j
https://grails.apache.org/docs/latest/guide/upgrading.html#upgrading60x mentions this document & also has a script to automate 90% of these changes to your gradle files
d
yea i ran the script and felt like it got 50% of them
j
we didnt' do every permutation with it. PR's are welcome to improve it 😃
We tried openrewrite, but then they went private source & don't support groovy that well - we weren't goign to contribute to their product if they didn't want to be opensource
👍 1