The contents of a config file can be relocated, or replicated, within the config, via package overrides.
@package directive specifies a common package for all nodes in the config file.
It must be placed at the top of each
config group file.
A package directive with
The following example adds the
mysql config in the packages
The primary config, named in
@hydra.main() should not have a package directive.
For config files in config groups the default depends on the version:
- In Hydra 0.11, there was an implicit default of
- Hydra 1.0 the default is
A warning is issued for each config group file without a
- In Hydra 1.1 the default for config group files will become
By adding an explicit
@package to your configs files, you guarantee that they
will not break when you upgrade to Hydra 1.1.