[TOC]
要求
classpath 'com.android.tools.build:gradle:1.3.0'
以上- distributionUrl=https://services.gradle.org/distributions/gradle-2.8-all.zip 2.8以上
在Android Studio 工程的根目录
的 build.gradle
文件中配置
allprojects {
repositories {
jcenter()
maven {
url 'http://yournexus:port/nexus/content/repositories/android-releases/'
}
}
}
或者在需要使用的module
的build.gradle
中配置
repositories {
maven {
url 'http://yournexus:port/nexus/content/repositories/android-releases/'
}
}
在module的 build.gradle
文件中使用
dependencies {
// jar at taget version
compile group: 'com.your.package', name: 'pacakge', version: '1.0.0'
// aar at taget version
compile group: 'com.your.package', name: 'pacakge', version: '1.0.1@aar'
// last version with aar
compile group: 'com.your.package', name: 'pacakge', version: 'latest.integration@aar'
}
// uploadArchives only jarLib
apply from: "https://github.com/sinlov/Gradle_Zoo/raw/master/nexus/nexus-publish-only-jarLib.gradle"
// uploadArchives without javadoc and Sources
apply from: "https://github.com/sinlov/Gradle_Zoo/raw/master/nexus/nexus-publish-no-doc-sources.gradle"
// uploadArchives without javadoc
apply from: "https://github.com/sinlov/Gradle_Zoo/raw/master/nexus/nexus-publish-no-javadoc.gradle"
// uploadArchives all
apply from: "https://github.com/sinlov/Gradle_Zoo/raw/master/nexus/nexus-publish-all.gradle"