3.7.5 Dependencias por defecto - Reference Documentation
Authors: Graeme Rocher, Peter Ledbrook, Marc Palmer, Jeff Brown, Luke Daley, Burt Beckwith
Version: null
3.7.5 Dependencias por defecto
Most Grails applications have runtime dependencies on several jar files that are provided by the Grails framework. These include libraries like Spring, Sitemesh, Hibernate etc. When a war file is created, all of these dependencies will be included in it. But, an application may choose to exclude these jar files from the war. This is useful when the jar files will be provided by the container, as would normally be the case if multiple Grails applications are deployed to the same container.The dependency resolution DSL provides a mechanism to express that all of the default dependencies will be provided by the container. This is done by invoking the
La mayoría de las aplicaciones Grails tienen dependencias de tiempo de ejecución sobre varios archivos jar que proporcionan el framwork Grails. Estos incluyen bibliotecas como Spring, Sitemesh, Hibernate, etc… Cuando se crea un archivo war, todas estas dependencias se incluirá en él. Sin embargo, una aplicación puede excluir estos archivos jar del war. Esto es útil cuando los archivos jar serán proporcionados por el contenedor, ya que normalmente sería el caso si varias aplicaciones Grails se despliegan en el mismo contenedor.La resolución de dependencias DSL proporciona un mecanismo para expresar que todas las dependencias predeterminado serán proporcionados por el contenedor. Esto se hace invocando al método defaultDependenciesProvided method and passing true as an argument:defaultDependenciesProvided y pasando true como argumento:grails.project.dependency.resolution = { defaultDependenciesProvided true // all of the default dependencies will
// be "provided" by the container inherits "global" // inherit Grails' default dependencies repositories {
grailsHome()
…
}
dependencies {
…
}
}defaultDependenciesProvidedmust come beforeinherits, otherwise the Grails dependencies will be included in the war.
defaultDependenciesProvideddebe venir antes deinherits, de lo contrario las dependencias Grails se incluirá en el war.

