Maven 脱机Jenkins Android Gradle构建服务器的配置
我一直在尝试使用以下设置为我的团队(Android开发)维护构建服务器:Maven 脱机Jenkins Android Gradle构建服务器的配置,maven,jenkins,gradle,android-gradle-plugin,commonsware-cwac,Maven,Jenkins,Gradle,Android Gradle Plugin,Commonsware Cwac,我一直在尝试使用以下设置为我的团队(Android开发)维护构建服务器: Windows Server 2008 詹金斯 詹金斯的Gradle插件 由于力量超出我的控制,服务器必须脱机。它连接到离线git repo以获取我们的源代码。如果需要安装更新,我们可以临时访问internet,但否则机器将脱机 然而,它在很长一段时间(超过一年)内一直运行良好。我们一直使用的模式是,如果我们更改依赖项(如SDK,或来自jcenter的库,如'org.greenrobot:greendao:2.2.1'
- Windows Server 2008
- 詹金斯
- 詹金斯的Gradle插件
buildscript {
repositories {
jcenter()
maven {
url "https://plugins.gradle.org/m2/"
}
}
}
allprojects {
repositories {
jcenter()
maven {
url "https://s3.amazonaws.com/repo.commonsware.com"
}
}
}
dependencies {
compile 'com.android.support:multidex:1.0.1'
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'org.greenrobot:greendao:2.2.1'
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:cardview-v7:23.4.0'
compile 'com.android.support:design:23.4.0'
compile 'com.google.android.gms:play-services-location:9.0.0'
compile 'com.commonsware.cwac:merge:1.1.+'
}
以下是我们的应用程序build.gradle中的一个片段:
buildscript {
repositories {
jcenter()
maven {
url "https://plugins.gradle.org/m2/"
}
}
}
allprojects {
repositories {
jcenter()
maven {
url "https://s3.amazonaws.com/repo.commonsware.com"
}
}
}
dependencies {
compile 'com.android.support:multidex:1.0.1'
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'org.greenrobot:greendao:2.2.1'
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:cardview-v7:23.4.0'
compile 'com.android.support:design:23.4.0'
compile 'com.google.android.gms:play-services-location:9.0.0'
compile 'com.commonsware.cwac:merge:1.1.+'
}
在Jenkins上构建时,如果可以访问互联网,则构建可以正常进行。
但是,如果没有互联网接入,它将因maven回购协议而失败:
java.net.ConnectException: Connection refused: connect
File C:\Users\ciandroid\.android\repositories.cfg could not be loaded.
Failed to download any source lists!
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':app'.
> Could not resolve all dependencies for configuration ':app:_debugApkCopy'.
> Could not resolve com.commonsware.cwac:merge:1.1.+.
Required by:
My-App:app:unspecified
> Could not resolve com.commonsware.cwac:merge:1.1.+.
> Failed to list versions for com.commonsware.cwac:merge.
> Unable to load Maven meta-data from https://s3.amazonaws.com/repo.commonsware.com/com/commonsware/cwac/merge/maven-metadata.xml.
> Could not GET 'https://s3.amazonaws.com/repo.commonsware.com/com/commonsware/cwac/merge/maven-metadata.xml'.
> Connect to s3.amazonaws.com:443 [s3.amazonaws.com/52.216.0.27] failed: Connection refused: connect
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
如何将其配置为缓存此其他回购?我遗漏了什么?最简单的解决方案可能是只做一件事。其他人已经为
RecyclerView
实现了类似的功能,这也是更多应用程序开发的方向,因此我预计不会再对该库进行太多更改。