qotd My First Grails App

11 June 2015

Create an app

$ grails create-app qotd
| Application created at /home/drmanalo/intellij/qotd

Enjoy the fruit of your hardwork

$ cd qotd

$ grails run-app
> Configuring > 0/1 projects > root project > Resolving dependencies ':classpath1/1 projects > Resolving dependencies ':agent' > Resolving dependencies ':versio:compileJava UP-TO-DATE
> Building 16% > :compileGroovy > Resolving dependencies ':compile' > Resolving :compileGroovy
Download https://repo.grails.org/grails/core/xml-apis/xml-apis/1.0.b2/xml-apis-1.0.b2.jar
> Building 16% > :compileGroovy > Resolving dependencies 'detachedConfiguration4:processResources
:classes
:findMainClass
> Building 83% > :bootRun > Resolving dependencies ':runtime' > Resolving depend:bootRun
Download https://repo.grails.org/grails/core/commons-io/commons-io/2.2/commons-io-2.2.jar
Grails application running at http://localhost:8080

By typing a one-liner grails command, I have a fully working web application. I wish there is a similar story on Spring framework. To be fair though, Spring Boot has opinionated way of doing things but if you want rapid prototyping, then grails is the answer. If you will inspect the files created by create-app, there is a reasonable number of.

$ tree qotd/
qotd/
├── build.gradle
├── gradle
│   └── wrapper
│       ├── gradle-wrapper.jar
│       └── gradle-wrapper.properties
├── gradle.properties
├── gradlew
├── gradlew.bat
├── grails-app
│   ├── assets
│   │   ├── images
│   │   │   ├── apple-touch-icon.png
│   │   │   ├── apple-touch-icon-retina.png
│   │   │   ├── favicon.ico
│   │   │   ├── grails_logo.png
│   │   │   ├── skin
│   │   │   │   ├── database_add.png
│   │   │   │   ├── database_delete.png
│   │   │   │   ├── database_edit.png
│   │   │   │   ├── database_save.png
│   │   │   │   ├── database_table.png
│   │   │   │   ├── exclamation.png
│   │   │   │   ├── house.png
│   │   │   │   ├── information.png
│   │   │   │   ├── shadow.jpg
│   │   │   │   ├── sorted_asc.gif
│   │   │   │   └── sorted_desc.gif
│   │   │   ├── spinner.gif
│   │   │   └── springsource.png
│   │   ├── javascripts
│   │   │   ├── application.js
│   │   │   └── jquery-2.1.3.js
│   │   └── stylesheets
│   │       ├── application.css
│   │       ├── errors.css
│   │       ├── main.css
│   │       └── mobile.css
│   ├── conf
│   │   ├── application.yml
│   │   ├── logback.groovy
│   │   └── spring
│   │       └── resources.groovy
│   ├── controllers
│   │   └── UrlMappings.groovy
│   ├── domain
│   ├── i18n
│   │   ├── messages_cs_CZ.properties
│   │   ├── messages_da.properties
│   │   ├── messages_de.properties
│   │   ├── messages_es.properties
│   │   ├── messages_fr.properties
│   │   ├── messages_it.properties
│   │   ├── messages_ja.properties
│   │   ├── messages_nb.properties
│   │   ├── messages_nl.properties
│   │   ├── messages_pl.properties
│   │   ├── messages.properties
│   │   ├── messages_pt_BR.properties
│   │   ├── messages_pt_PT.properties
│   │   ├── messages_ru.properties
│   │   ├── messages_sv.properties
│   │   ├── messages_th.properties
│   │   └── messages_zh_CN.properties
│   ├── init
│   │   ├── BootStrap.groovy
│   │   └── qotd
│   │       └── Application.groovy
│   ├── services
│   ├── taglib
│   ├── utils
│   └── views
│       ├── error.gsp
│       ├── index.gsp
│       ├── layouts
│       │   └── main.gsp
│       └── notFound.gsp
└── src
    ├── integration-test
    │   └── groovy
    ├── main
    │   ├── groovy
    │   └── webapp
    └── test
        └── groovy