I am creating a new empty grails 6 project (have tried version 6.1.2, 6.1.1, 6.1.0, 6.0.0) via the create-restapi command per their example:
grails create-restapi -i bookstore
the resulting project fails to build and recommends running
gradle dependencies
gradle dependencies shows 2 issues as follows:
Configure project : Cannot resolve reloading agent JAR: Failed to resolve imported Maven boms: Cannot resolve external dependency org.springframework.boot:spring-boot-dependencies:2.7.18 because no repositories are defined. Required by: project :
FAILURE: Build failed with an exception.
- What went wrong: An exception occurred applying plugin request [id: 'org.grails.plugins.views-json', version: '3.1.1']
Failed to apply plugin 'org.grails.plugins.views-json'. Could not create task ':compileGsonViews'. > Could not create task of type 'JsonViewCompilerTask'. > java.lang.InstantiationException (no error message)
not sure if related but coming from previous versions of grails i was surprised these commands did not create a domain folder inside grails-app.
i have tried with all the grails 6 versions and i get this flavor of error on them all. also tried create-app instead of create-restapi and same result - build failure and the above output from gradle dependencies. Tried also creating thru Intellij IDEA Grails Application Forge with the same result. I feel like im missing something simple but i cant figure it out.
Anyone else experience this? Any ideas?
This problem was due to the use of gradle instead of ./gradlew in my project. Though configured to use gradle wrapper, my Intellij seems to ignore it.
'gradle dependencies' was failing but './gradlew dependencies' works
likewise './gradlew bootRun' successfully starts the application.
in the Intellij run configuration, i was not able to get the Configuration of type "Grails" to call gradlew or start the project. This works fine with all previous versions of Grails i have (2, 3, 4, 5) but i have not been able to get it to work with grails 6.
instead. i made a Run configuration of type 'Gradle', and had it run 'bootRun' .
Now i am able to run the Grails project (6.1.2) using the run and debug buttons in Intellij.