无法解决 class org.apache.commons.configuration.PropertiesConfiguration
Getting unable to resolve class org.apache.commons.configuration.PropertiesConfiguration
我是 groovy 的 Grails 新手。
在我的 grails 应用程序中,我必须编辑一个 属性 文件而不删除我使用 apache commons
以下代码
的其他键值
PropertiesConfiguration conf = new PropertiesConfiguration("config.properties");
props.setProperty("key", "value");
conf.save();
在 BuildConfig.groovy
中我包含了依赖关系
dependencies {
compile 'org.apache.commons:commons-configuration2:2.2'
compile 'org.apache.commons:commons-lang3:3.1'
}
在执行 grails compile
时似乎没有任何错误地下载了依赖项,但我遇到了编译错误
unable to resolve class org.apache.commons.configuration.PropertiesConfiguration
[groovyc] @ line 5, column 1.
[groovyc] import org.apache.commons.configuration.PropertiesConfiguration;
[groovyc] ^
[groovyc]
我需要在 grails 中做哪些额外的设置,请建议
使用
import org.apache.commons.configuration2.PropertiesConfiguration;
注意配置末尾的2!
我是 groovy 的 Grails 新手。
在我的 grails 应用程序中,我必须编辑一个 属性 文件而不删除我使用 apache commons
以下代码
PropertiesConfiguration conf = new PropertiesConfiguration("config.properties");
props.setProperty("key", "value");
conf.save();
在 BuildConfig.groovy
中我包含了依赖关系
dependencies {
compile 'org.apache.commons:commons-configuration2:2.2'
compile 'org.apache.commons:commons-lang3:3.1'
}
在执行 grails compile
时似乎没有任何错误地下载了依赖项,但我遇到了编译错误
unable to resolve class org.apache.commons.configuration.PropertiesConfiguration
[groovyc] @ line 5, column 1.
[groovyc] import org.apache.commons.configuration.PropertiesConfiguration;
[groovyc] ^
[groovyc]
我需要在 grails 中做哪些额外的设置,请建议
使用
import org.apache.commons.configuration2.PropertiesConfiguration;
注意配置末尾的2!