5.5.1 Defining Dependencies with Gradle

Dependencies for your project are defined in the dependencies block. In general you can follow the Gradle documentation on dependency management to understand how to configure additional dependencies.

The default dependencies for the "web" profile can be seen below:

  1. dependencies {
  2. compile 'org.springframework.boot:spring-boot-starter-logging'
  3. compile('org.springframework.boot:spring-boot-starter-actuator')
  4. compile 'org.springframework.boot:spring-boot-autoconfigure'
  5. compile 'org.springframework.boot:spring-boot-starter-tomcat'
  6. compile 'org.grails:grails-dependencies'
  7. compile 'org.grails:grails-web-boot'
  8. compile 'org.grails.plugins:hibernate'
  9. compile 'org.grails.plugins:cache'
  10. compile 'org.hibernate:hibernate-ehcache'
  11. runtime 'org.grails.plugins:asset-pipeline'
  12. runtime 'org.grails.plugins:scaffolding'
  13. testCompile 'org.grails:grails-plugin-testing'
  14. testCompile 'org.grails.plugins:geb'
  15. // Note: It is recommended to update to a more robust driver (Chrome, Firefox etc.)
  16. testRuntime 'org.seleniumhq.selenium:selenium-htmlunit-driver:2.44.0'
  17. console 'org.grails:grails-console'
  18. }

Note that version numbers are not present in the majority of the dependencies. This is thanks to the dependency management plugin which configures a Maven BOM that defines the default dependency versions for certain commonly used dependencies and plugins:

  1. dependencyManagement {
  2. imports {
  3. mavenBom 'org.grails:grails-bom:' + grailsVersion
  4. }
  5. applyMavenExclusions false
  6. }