I am getting this error while trying to add db.properties
file in build.gradle
file
build.gradle:
allprojects {
apply from: 'db.properties'
apply from: 'deployment.properties'
repositories {
mavenCentral()
}
apply plugin: 'java'
apply plugin: 'war'
apply plugin: 'maven-publish'
apply plugin: 'idea'
sourceCompatibility = 1.8
}
db.properties:
db=blal
dbUsername=/bilal/home
Error I am getting is:
* Where:
Script 'camelawsextractionservicesb/db.properties' line: 1
* What went wrong:
A problem occurred evaluating script.
> Could not find property 'blal' on root project 'CamelExtractionServices'.
If you're looking to load properties from an .properties
file, I would try something like this:
ext.additionalProperties = new Properties().load(file("db.properties").newReader())
ext.someOtherProperties = new Properties().load(file("foo.properties").newReader())
Then you can access your properties:
println additionalProperties['db']
println someOtherProperties['bar']
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With