2017-01-26 52 views
0

我發展與包括像butterknife和滑行一些依賴,但畢竟它已經被部署到我的私人artifactory的,所有的依賴性不包括我的圖書館很小的MVP庫,所以所有的依賴性在使用這個庫時我的項目沒有解決。我是新的這個artifactory,是我失去了什麼?後不包括外部依賴性部署到artifactory的

這是我的根的build.gradle:

buildscript { 
repositories { 
    jcenter() 
} 
dependencies { 
    classpath 'com.android.tools.build:gradle:2.2.3' 

    // NOTE: Do not place your application dependencies here; they belong 
    // in the individual module build.gradle files 
    classpath "org.jfrog.buildinfo:build-info-extractor-gradle:4.0.1" 
    classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8' 
    } 
} 

allprojects { 
    repositories { 
    jcenter() 
    } 
} 

task clean(type: Delete) { 
    delete rootProject.buildDir 
} 

,這是我的build.gradle模塊:

apply plugin: 'com.android.library' 
apply plugin: 'com.jfrog.artifactory' 
apply plugin: 'maven-publish' 
apply plugin: 'me.tatarka.retrolambda' 

def libraryGroupId = 'com.pixilapps.pixilframework' 
def libraryArtifactId = 'mvp' 
def libraryVersion = '1.0.0' 

publishing { 
    publications { 
     aar(MavenPublication) { 
      groupId libraryGroupId 
      version libraryVersion 
      artifactId libraryArtifactId 
      artifact("$buildDir/outputs/aar/${artifactId}-release.aar") 
     } 
    } 
} 

artifactory { 
    contextUrl = 'http://my.lib.web/artifactory' 
    publish { 
     repository { 
      repoKey = 'libs-release-local' 

      username = artifactory_username 
      password = artifactory_password 
     } 
     defaults { 
      publications('aar') 
      publishArtifacts = true 

      properties = ['qa.level': 'basic', 'q.os': 'android', 'dev.team': 'core'] 
      publishPom = true 
     } 
    } 
} 

buildscript { 
    repositories { 
     mavenCentral() 
     jcenter() 
    } 

    dependencies { 
     classpath 'me.tatarka:gradle-retrolambda:3.3.1' 
    } 
} 

repositories { 
    mavenCentral() 
    jcenter() 
    maven { url "https://clojars.org/repo/" } 
    maven { url "https://jitpack.io" } 
    maven { 
     url "https://s3.amazonaws.com/repo.commonsware.com" 
    } 
    maven { url "https://oss.sonatype.org/content/repositories/snapshots/" } 
    maven { 
     url "http://dl.bintray.com/glomadrian/maven" 
    } 
} 

android { 
    compileSdkVersion 25 
    buildToolsVersion "25.0.0" 

    defaultConfig { 
     minSdkVersion 17 
     targetSdkVersion 25 
     versionCode 1 
     versionName "1.0" 

     testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 

    } 
    buildTypes { 
     release { 
      minifyEnabled false 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
     } 
    } 
    compileOptions { 
     sourceCompatibility JavaVersion.VERSION_1_8.toString() 
     targetCompatibility JavaVersion.VERSION_1_8.toString() 
    } 
} 

dependencies { 
    final PLAY_SERVICES_VERSION = '9.6.1' 
    final DEXMAKER_VERSION = '1.4' 
    final HAMCREST_VERSION = '1.3' 
    final ESPRESSO_VERSION = '2.2.1' 
    final RUNNER_VERSION = '0.4' 
    final AUTO_VALUE_VERSION = '1.3' 
    final AUTO_VALUE_GSON_VERSION = '0.4.2' 
    final SUPPORT_LIBRARY_VERSION = '25.1.0' 
    final RETROFIT_VERSION = '2.1.0' 
    final BUTTERKNIFE_VERSION = '7.0.1' 
    compile fileTree(dir: 'libs', include: ['*.jar']) 
    compile "com.android.support:appcompat-v7:$SUPPORT_LIBRARY_VERSION" 
    compile "com.android.support:recyclerview-v7:$SUPPORT_LIBRARY_VERSION" 
    compile "com.android.support:cardview-v7:$SUPPORT_LIBRARY_VERSION" 
    compile "com.android.support:support-annotations:$SUPPORT_LIBRARY_VERSION" 
    compile "com.squareup.retrofit2:retrofit:$RETROFIT_VERSION" 
    compile "com.squareup.retrofit2:converter-gson:$RETROFIT_VERSION" 
    compile "com.squareup.retrofit2:adapter-rxjava:$RETROFIT_VERSION" 
    compile 'com.github.bumptech.glide:glide:3.7.0' 
    compile 'io.reactivex:rxandroid:1.2.1' 
    compile 'io.reactivex:rxjava:1.1.6' 
    compile 'com.jakewharton.timber:timber:4.1.2' 
    compile 'com.squareup.okhttp3:logging-interceptor:3.4.1' 
    compile 'com.squareup.okhttp3:okhttp:3.4.1' 
    compile 'com.vistrav:ask:2.4' 
    compile "com.jakewharton:butterknife:$BUTTERKNIFE_VERSION" 
    compile 'com.michaelpardo:activeandroid:3.1.0-SNAPSHOT' 
    compile 'net.danlew:android.joda:2.9.3.1' 
    compile 'com.pixplicity.easyprefs:library:1.7' 
} 

回答

1

您可以在publishing塊使用pom.withXml,如描述here(找到約pom.withXml here官方文檔)。

它看起來象是處理這個,我想:

publishing { 
    publications { 
     aar(MavenPublication) { 
      groupId libraryGroupId 
      version = libraryVersion 
      artifactId libraryArtifactId 
      artifact("$buildDir/outputs/aar/${project.getName()}-release.aar") 

      pom.withXml { 
       def dependencies = asNode().appendNode('dependencies') 
       configurations.getByName("_releaseCompile").getResolvedConfiguration().getFirstLevelModuleDependencies().each { 
        def dependency = dependencies.appendNode('dependency') 
        dependency.appendNode('groupId', it.moduleGroup) 
        dependency.appendNode('artifactId', it.moduleName) 
        dependency.appendNode('version', it.moduleVersion) 
       } 
      } 
     } 
    } 
} 
+0

我收到錯誤消息「配置名爲‘_releaseCompile’未找到」上構建 – DragonT

+0

在Android 3.0.1工作室和搖籃4.2我改變configurations.getByName(「releaseCompileClasspath」),併爲我工作。 – DragonT