Skip to content
Danny Thomas edited this page May 17, 2016 · 6 revisions

Dependency rules are read from the resolutionRules configuration. Zip and jar archives are supported, as are flat JSON files. JSON files within archives can at any directory level, and more than one json file can be provided.

dependencies {
    resolutionRules files('local-rules.json')
    resolutionRules 'com.myorg:resolution-rules:latest.release'
}

Rules are named using the filename of the rules file, omitting the .json extension.

Including rules

By default, all non-optional rules are applied. To enable only the specified rules, use:

nebulaResolutionRules {
    include = ['local-rules']
}

Excluding rules

Rules can be excluded using:

nebulaResolutionRules {
    exclude = ['local-rules']
}

If includes are specified, exclude is ignored.

Including optional rules

Optional rules files are prefixed with optional-, and can be enabled using optional:

dependencies {
    resolutionRules files('optional-local-rules.json')
}

nebulaResolutionRules {
    optional = ['local-rules']
}

Dependency lock compatibility

To use nebula.dependency-lock with this plugin, apply nebula.dependency-lock later than the resolution rules plugin.