1
我一直在嘗試上傳一個項目到Maven存儲庫失敗。這裏是我的項目結構:Android多模塊與味道到Maven存儲庫
_root
|_ lib1 (aar)
|_ lib2 (aar)
|_ javalib (jar)
- LIB1取決於LIB2
- LIB2取決於javalib
- LIB1和LIB2有兩種口味(INTG和生產線)
問題是什麼時候啓動uploadArchives任務我沒有創建pom.xml。 這似乎是由於我的口味(當我刪除口味,它工作正常),我不知道如何解決這個問題。 我真的需要風味工作...任何幫助是值得歡迎;)
這裏是我的build.gradle文件:
根:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.1.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
ext.versionName = "$System.properties.version"
configure(subprojects) {
apply plugin: 'maven'
group = 'com.test.build'
version = project.versionName
uploadArchives {
repositories {
mavenDeployer {
repository(url: "http://localhost:8081/content/repositories/test/") {
authentication(userName: "admin", password: "admin123")
}
}
}
}
}
allprojects {
repositories {
jcenter()
}
}
LIB1:
apply plugin: 'com.android.library'
android {
publishNonDefault true
compileSdkVersion 22
buildToolsVersion "22.0.1"
defaultConfig {
minSdkVersion 15
targetSdkVersion 22
versionCode 1
versionName project.versionName
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
productFlavors {
prod{}
intg{}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
intgCompile project(path: ':lib2', configuration: 'intgRelease')
prodCompile project(path: ':lib2', configuration: 'prodRelease')
}
lib2:
apply plugin: 'com.android.library'
android {
publishNonDefault true
compileSdkVersion 22
buildToolsVersion "22.0.1"
defaultConfig {
minSdkVersion 15
targetSdkVersion 22
versionCode 1
versionName project.versionName
}
buildTypes {
debug {
}
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
productFlavors {
prod{}
intg{}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile project(path: ':javalib')
}
javalib:
apply plugin: 'java'
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
}