YAML allows you to use anchors (&), similar to ID attributes in XML, and reference them later on (*). For example, if you have two profiles that are identical, you can tell YAML that one is an alias for the other:

development: &common
  db: oracle
  port: 8080
test: *common
production: *common

If you have two elements that are almost identical, you can merge the values of one element into another (<<), for example:

development: &common
  db: hsql
  jdbc: hsqldb:mem:devdb
  <<: *common
  jdbc: hsqldb:file:testdb
  • No labels