6.6 Creating Profile Features - Reference Documentation
Authors: Graeme Rocher, Peter Ledbrook, Marc Palmer, Jeff Brown, Luke Daley, Burt Beckwith, Lari Hotari
Version: 3.1.1
6.6 Creating Profile Features
A Profile feature is a shareable set of templates and dependencies that may span multiple profiles. Typically you create a base profile that has multiple features and child profiles that inherit from the parent and hence can use the features available from the parent.To create a feature use thecreate-feature
command from the root directory of your profile:$ grails create-feature myfeature
myfeature/feature.yml
file that looks like the following:description: Description of the feature
# customize versions here
# dependencies:
# compile:
# - "org.grails.plugins:myplugin2:1.0"
#
feature.yml
file from the "asset-pipeline" feature:description: Adds Asset Pipeline to a Grails project
build:
plugins:
- asset-pipeline
dependencies:
build:
- 'com.bertramlabs.plugins:asset-pipeline-gradle:2.5.0'
runtime:
- "org.grails.plugins:asset-pipeline"
FEATURE_DIR * feature.yml * skeleton * grails-app * conf * application.yml * build.gradle
application.yml
and build.gradle
get merged with their respective counterparts in the profile by used.With the feature.yml
you can define additional dependencies. This allows users to create applications with optional features. For example:$ grails create-app myapp --profile myprofile --features myfeature,hibernate