Joh*_*nha 0 android gradle android-studio
我有要使用的库,可以安装一个版本,但是开发人员发布了最新的SNAPSHOT版本,如何编译它?
我尝试了compile 'com.(...):1.4.0-SNAPSHOT没有结果?
由于SNAPSHOT是Maven概念,因此在存储库中不会将其视为任何特殊内容。
告诉Gradle检查依赖项更新版本的最佳方法是将依赖项标记为更改。Gradle然后将每24小时检查一次更新,可以使用resolutionStrategy DSL 进行配置。
覆盖Gradle中的默认模块缓存:
configurations.all {
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
}
Run Code Online (Sandbox Code Playgroud)
然后,latest.integration将与每个SNAPSHOT一起使用:
dependencies {
compile ('projGroup:projName:latest.integration') { changing = true }
}
Run Code Online (Sandbox Code Playgroud)
例如,在您的情况下,projGroup是com.prolificinteractive,projName是material-calendarview。
dependencies {
compile('com.prolificinteractive:material-calendarview:1.4.0-SNAPSHOT') { changing = true }
}
Run Code Online (Sandbox Code Playgroud)
另一个问题是,在定义的中央存储库中引入了最新版本时,该存储库实际上不包含SNAPSHOT存储库所在的-SNAPSHOT位置。因此,您应该将gradle repositories存储库URL 添加到您的部分中,以允许下载上载的SNAPSHOT版本。
repositories {
mavenCentral()
mavenLocal()
maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1814 次 |
| 最近记录: |