Page tree
Skip to end of metadata
Go to start of metadata

With Rabbtor, you can use .groovy files for configuring your Spring Boot applications instead of YAML and Properties files. 

With Groovy's powerful and easy dynamic features, you can generate dynamic configuration files easily. 

Groovy Configuration Support is automatically enabled in a Spring Boot Application if  'rabbtor-core' library is in your classpath. 

Below is a example build.gradle file for referencesing rabbtor-core

 

compile 'com.rabbtor:rabbtor-core:1.0.4'

 

Below is a sample application.groovy file:

 
spring {
	gsp {
		enabled = true
		taglib {
			packages = ['pckg1','pckg2'].collect { "com.rabbtor.example.${it}.tags" }
		}
	}
}
 
def defaultJdbcUrl = 'jdbc:mysql://localhost/db'
app {
	(1..3).each {
		this."db${it}" = "${defaultJdbcUrl}${it}"
	}
	
}
 
environments {
	development {
		server.port = 8080
	}
	test {
		server.port = 8090
	}
}
  • No labels