Grails 3 'grails' vs. 'gradlew' issues

I am experimenting with Grails 3 which is completely based on Gradle. To create an application, I run:

grails create-app myapp

      

Then, to integrate it with Eclipse, I run:

gradlew eclipse

      

Then, to create a new controller, I run:

grails create-controller org.me.myapp.test

      

Then, to run any custom Gradle task, I run:

gradlew mytask

      

I think I am confused which tasks I am running through grails

and which ones I am running through gradlew

. No documentation exists on this subject - any ideas?

+3


source to share


1 answer


Grails app doesn't exist until you run

grails create-app MyApp

      

After that, gradle is available through the wrapper. Just cd into the MyApp directory and ask the generated gradle wrapper what it can do:

./gradlew tasks

      

Wow! That's a lot ...

More details: https://grails.github.io/grails-doc/latest/guide/commandLine.html#gradleBuild

But ... In the beginning, all grails commands were supposed to be accessible through the gradle shell, but the development team discovered some tricky things at the end of 3.0 development and had to postpone this idea ... So from 3.0.9, all tasks with a code generator are all are still done with the simple, familiar grails command. We need a madman. Just use:



grails create-domain crazy.Person

      

But if you want to run your crazy. Sample unit tests, you are using:

./gradlew test --tests *Person*

      

Or check everything:

./gradlew test

      

Clean like dirt? spoiler Changes in Grails 3.1 may make interactions less schizophrenic.

+1


source







All Articles