0
我有这个库我想用,我可以安装一个版本,但是开发者发布了最近的SNAPSHOT版本,我该如何编译它?我试过compile 'com.(...):1.4.0-SNAPSHOT
没有结果?Gradle:编译SNAPSHOT库
我有这个库我想用,我可以安装一个版本,但是开发者发布了最近的SNAPSHOT版本,我该如何编译它?我试过compile 'com.(...):1.4.0-SNAPSHOT
没有结果?Gradle:编译SNAPSHOT库
由于SNAPSHOT是一个Maven概念,因此它在存储库中不被视为任何特殊的东西。
告诉Gradle
检查依赖项的更新版本的最好方法是将依赖项标记为更改。然后Gradle
会每24小时检查一次更新,这可以使用分辨率策略 DSL进行配置。
覆盖默认模块中的缓存摇篮:
configurations.all {
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
}
然后,latest.integration
将与每个快照工作:
dependencies {
compile ('projGroup:projName:latest.integration') { changing = true }
}
例如,在你的情况,projGroup是com.prolificinteractive和projName
is material-calendarview。
dependencies {
compile('com.prolificinteractive:material-calendarview:1.4.0-SNAPSHOT') { changing = true }
}
另一个问题是,把上定义的中央库的最新版本,这个仓库实际上是不包含快照库,其中-SNAPSHOT
所在地。所以你应该在你的gradle repositories
部分添加仓库URL,以允许下载上传的SNAPSHOT版本。
repositories {
mavenCentral()
mavenLocal()
maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
}
此'编译 'projGroup:com.prolificinteractive:材料calendarview:1.3.0:latest.integration''给出了这样的错误:'错误:(37,0)提供的字符串模块符号' projGroup:COM。 prolificinteractive:material-calendarview:1.3.0:latest.integration'无效。示例符号:'org.gradle:gradle-core:2.2','org.mockito:mockito-core:1.9.5:javadoc'.' –
使用'compile'com.prolificinteractive:material-calendarview:latest.integration'' –
它现在正在编译,但仍不是最新版本,有些方法缺失 –