Loj*_*Ibg 5 grails ivy apache-commons-codec google-reporting-api
我正在尝试检索Google Reporting API的库:
compile 'com.google.apis:google-api-services-analytics:v3-rev74-1.17.0-rc'
Run Code Online (Sandbox Code Playgroud)
但我得到了一个未解决的依赖项错误,我不知道如何处理它:
:: commons-codec#commons-codec;1.6: configuration not found in commons-codec#commons-codec;1.6: 'master'. It was required from org.apache.httpcomponents#httpclient;4.0.1 compile
Run Code Online (Sandbox Code Playgroud)
我检查了.grails\ivy-cache \文件夹,并且有一个commons-codec文件夹,其中包含jars of commons-codec-1.5,少量xml文件ivy-1.5.xml和ivy-1.6.xml以及ivydata-1.5.properties和ivydata- 1.6.properties.我也尝试删除整个ivy-cache文件夹,但结果是一样的.
就在写完我的问题后,我找到了答案。将“compile”范围更改为“build”应该可以解决该错误:
build 'com.google.apis:google-api-services-analytics:v3-rev74-1.17.0-rc'
Run Code Online (Sandbox Code Playgroud)
实际上,这解决了我之前的问题,但又提出了另一个问题:)“构建”范围仅在编译时包含库,但在运行时不包含库!因此,当部署到 Tomcat 时,我没有可用的 google-api-services-analytics。我的最终可行的解决方案是:
dependencies {
def googleLibVersion = "1.17.0-rc"
compile("com.google.apis:google-api-services-analytics:v3-rev74-${googleLibVersion}") {
excludes "commons-codec"
}
compile("com.google.http-client:google-http-client-jackson2:${googleLibVersion}") {
excludes "commons-codec"
}
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3572 次 |
| 最近记录: |