Android studio Android studio未将工件发布到Artifactory

Android studio Android studio未将工件发布到Artifactory,android-studio,gradle,android-gradle-plugin,artifactory,android-studio-3.0,Android Studio,Gradle,Android Gradle Plugin,Artifactory,Android Studio 3.0,我在Android Studio和Artifactory方面遇到了一个奇怪的问题。我想从Android Studio发布一个模块。问题是,构建信息发布得很好,但是工件没有发布 格雷德尔先生 buildscript { repositories { google() jcenter() } dependencies { classpath 'com.android.tools.build:gradle:3.0.0'

我在Android Studio和Artifactory方面遇到了一个奇怪的问题。我想从Android Studio发布一个模块。问题是,构建信息发布得很好,但是工件没有发布

格雷德尔先生

buildscript {
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.0'
        classpath "org.jfrog.buildinfo:build-info-extractor-gradle:4.5.4"
    }
}

allprojects {
    apply plugin: "com.jfrog.artifactory"

    repositories {
        google()
        jcenter()
    }
}

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

artifactory {
    contextUrl = "${artifactory_contextUrl}"
    publish {
        repository {
            repoKey = 'libs-release-local'
            username = "${artifactory_user}"
            password = "${artifactory_password}"
            maven = true
        }
    }
    resolve {
        repository {
            repoKey = 'libs-release'
            username = "${artifactory_user}"
            password = "${artifactory_password}"
            maven = true
        }
    }
}
apply plugin: 'com.android.library'
apply plugin: 'maven-publish'

def packageName = 'x.x'
def libraryVersion = 'v1.0.0'

android {
    compileSdkVersion 26

    defaultConfig {
        minSdkVersion 21
        targetSdkVersion 26
        versionCode 10000
        versionName libraryVersion

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

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

publishing {
    publications {
        aar(MavenPublication) {
            groupId packageName
            version = libraryVersion
            artifactId "y"

            artifact("$buildDir/outputs/aar/$archivesBaseName-release.aar")
        }
    }
}

artifactory {
    publish {
        defaults {
            publications('aar')

            publishArtifacts = true
            publishBuildInfo = false
            publishPom = true
            publishIvy = false
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])

    implementation 'com.android.support:appcompat-v7:26.1.0'
    implementation 'com.android.support:support-v4:26.1.0'
    implementation 'com.android.support:design:26.1.0'

    implementation 'com.squareup.okhttp3:okhttp:3.8.1'
    implementation 'com.squareup.okhttp3:logging-interceptor:3.8.1'
    implementation 'com.squareup.retrofit2:retrofit:2.3.0'
    implementation 'com.squareup.retrofit2:converter-gson:2.3.0'

    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.1'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
}
模块/build.gradle

buildscript {
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.0'
        classpath "org.jfrog.buildinfo:build-info-extractor-gradle:4.5.4"
    }
}

allprojects {
    apply plugin: "com.jfrog.artifactory"

    repositories {
        google()
        jcenter()
    }
}

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

artifactory {
    contextUrl = "${artifactory_contextUrl}"
    publish {
        repository {
            repoKey = 'libs-release-local'
            username = "${artifactory_user}"
            password = "${artifactory_password}"
            maven = true
        }
    }
    resolve {
        repository {
            repoKey = 'libs-release'
            username = "${artifactory_user}"
            password = "${artifactory_password}"
            maven = true
        }
    }
}
apply plugin: 'com.android.library'
apply plugin: 'maven-publish'

def packageName = 'x.x'
def libraryVersion = 'v1.0.0'

android {
    compileSdkVersion 26

    defaultConfig {
        minSdkVersion 21
        targetSdkVersion 26
        versionCode 10000
        versionName libraryVersion

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

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

publishing {
    publications {
        aar(MavenPublication) {
            groupId packageName
            version = libraryVersion
            artifactId "y"

            artifact("$buildDir/outputs/aar/$archivesBaseName-release.aar")
        }
    }
}

artifactory {
    publish {
        defaults {
            publications('aar')

            publishArtifacts = true
            publishBuildInfo = false
            publishPom = true
            publishIvy = false
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])

    implementation 'com.android.support:appcompat-v7:26.1.0'
    implementation 'com.android.support:support-v4:26.1.0'
    implementation 'com.android.support:design:26.1.0'

    implementation 'com.squareup.okhttp3:okhttp:3.8.1'
    implementation 'com.squareup.okhttp3:logging-interceptor:3.8.1'
    implementation 'com.squareup.retrofit2:retrofit:2.3.0'
    implementation 'com.squareup.retrofit2:converter-gson:2.3.0'

    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.1'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
}
当我从终端运行
/gradlew assembleerelease artifactoryPublish
时,我总是得到以下输出:

> Task :minecommon:artifactoryPublish
Deploying build descriptor to: https://artifactory-domain/artifactory/api/build
Build successfully deployed. Browse it in Artifactory under https://artifactory-domain/artifactory/webapp/builds/project-name/1509633107114


BUILD SUCCESSFUL in 2s
26 actionable tasks: 1 executed, 25 up-to-date
我可以在我的工件的“构建浏览器”中找到构建

我的配置有问题吗?如何让gradle发布我的工件


关于这个问题,我已经尝试了我能找到的每一篇文章,但都没有找到解决办法。

你找到解决办法了吗?我当时也有同样的问题,我使用的是Artifactory OSS edition,它不支持AAR文件。现在我用的是NexusOSS,但还没有测试过。谢谢。我让它工作了finally@GokhanArik“你最终是怎么做到的?”拉博格我现在不记得了,已经有一段时间了,对不起。这可能与从模块vs项目运行它有关,或者凭据放在错误的位置。您找到解决方案了吗?我当时也有同样的问题,我使用的是Artifactory OSS edition,它不支持AAR文件。现在我用的是NexusOSS,但还没有测试过。谢谢。我让它工作了finally@GokhanArik“你最终是怎么做到的?”拉博格我现在不记得了,已经有一段时间了,对不起。这可能与从模块vs项目运行它有关,或者与凭据位置错误有关。