Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Modularizing groovy config workaround
// For structured comment of
// SecurityConfigPlain.groovy
security {
includeScript( SecurityDefaults )
active = true
password = 'redefined'
// and then use (OtherClass.groovy):
def configObjectPlain = new ConfigSlurper().parse(
class SecurityConfig extends ComposedConfigScript {
def run() { // normal contents of a config file go in here
${new File('SecurityConfigPlain.groovy').text}
println configObjectPlain
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment