Hello, I am trying to use Grails 7.0.0-M5 to creat...
# questions
g
Hello, I am trying to use Grails 7.0.0-M5 to create a plugin. I just did a create-plugin, then I try to run
Copy code
gradle build.
It failed with this error:
Copy code
> Configure project :
Cannot resolve reloading agent JAR: Failed to resolve imported Maven boms: Cannot resolve external dependency org.springframework.boot:spring-boot-dependencies:3.5.3 because no repositories are defined.
Required by:
    project :

FAILURE: Build failed with an exception.

* Where:
Build file '/Users/xxxx/work/dc/tmp_2/build.gradle' line: 19

* What went wrong:
A problem occurred evaluating root project 'test-common'.
> Failed to apply plugin 'org.apache.grails.gradle.grails-plugin'.
   > Could not create task ':findMainClass'.
      > Could not create task of type 'FindMainClassTask'.
         > 'org.gradle.api.file.ConfigurableFileCollection org.gradle.api.file.ConfigurableFileCollection.convention(java.lang.Object[])'

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at <https://help.gradle.org>

BUILD FAILED in 372ms
If I run
Copy code
./gradlw build
It failed with this error:
Copy code
tmp_2 % ./gradlew build

> Task :compileGroovy FAILED
startup failed:
/Users/xxx/work/dc/tmp_2/grails-app/init/test/common/BootStrap.groovy: 3: unable to resolve class jakarta.servlet.ServletContext
 @ line 3, column 1.
   import jakarta.servlet.ServletContext
   ^

1 error


[Incubating] Problems report is available at: file:///Users/xxx/work/dc/tmp_2/build/reports/problems/problems-report.html

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':compileGroovy'.
> Compilation failed; see the compiler error output for details.

* Try:
> Run with --scan to get full insights.

Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

For more on this, please refer to <https://docs.gradle.org/8.14/userguide/command_line_interface.html#sec:command_line_warnings> in the Gradle documentation.

BUILD FAILED in 1s
What could be wrong?
t
I get the same error when generating a new plugin
grails create-plugin
I tried creating one using https://start.grails.org/ and that works It seems this dependency is missing when generated from the commandline (build.gradle):
Copy code
implementation "org.apache.grails:grails-rest-transforms"
👍 1
j
I have reproduced this issue on M4, M5 and latest SNAPSHOT. I'll have a PR in a few minutes.
👍 2
There are some known additional differences with generated plugin dependencies which will be ironed out on https://github.com/apache/grails-core/issues/14944 and then updated in profiles and forge. That PR will make sure a generated plugin using profiles at least builds, for now.