Reputation: 7957
Iam new to groovy on grails.
In my grails application i have to edit a property file without deleting other key values for that Iam using apache commons
following code
PropertiesConfiguration conf = new PropertiesConfiguration("config.properties");
props.setProperty("key", "value");
conf.save();
In BuildConfig.groovy
I have included the depentencies
dependencies {
compile 'org.apache.commons:commons-configuration2:2.2'
compile 'org.apache.commons:commons-lang3:3.1'
}
While executing grails compile
the dependencies seems to be downloaded without any error, but that Iam getting the compilation error
unable to resolve class org.apache.commons.configuration.PropertiesConfiguration
[groovyc] @ line 5, column 1.
[groovyc] import org.apache.commons.configuration.PropertiesConfiguration;
[groovyc] ^
[groovyc]
What additional settings that i need to do in grails please suggest
Upvotes: 0
Views: 1321
Reputation: 518
Use
import org.apache.commons.configuration2.PropertiesConfiguration;
Note the 2 at the end of configuration!
Upvotes: 1