Artifactory上传丢失的模块

时间:2016-10-06 17:36:23

标签: android maven gradle repository artifactory

我尝试将.aar文件上传到Artifactory Server。我使用artifactoy插件:

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.2.0'
        classpath 'com.getkeepsafe.dexcount:dexcount-gradle-plugin:0.6.1'
        classpath 'com.github.ben-manes:gradle-versions-plugin:0.13.0' // version plugin support
        classpath 'com.github.dcendents:android-maven-gradle-plugin:1.4.1'
        //Check for the latest version here: http://plugins.gradle.org/plugin/com.jfrog.artifactory
        classpath "org.jfrog.buildinfo:build-info-extractor-gradle:4.4.5"
    }
}

我在过去2天内阅读了大量文档,无法弄清楚以下内容无效的原因:

首先,我不明白artifactory插件如何决定上传* .aar文件应该采用哪个存储库? 在Artifactory中有两种上传供内部使用的端点: lib-release-local lib_snapshot

在项目根目录中的build.gradle中,我定义了它们:

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

repositories {
    jcenter()
    maven { url "https://jitpack.io" }
    mavenLocal()
    mavenCentral()

    maven {
        url 'https://servername/artifactory/libs-release-local'
        credentials {
            username = "${artifactory_user}"
            password = "${artifactory_password}"
        }
    }

    maven {
        url 'https://servername/artifactory/libs-snapshot'
        credentials {
            username = "${artifactory_user}"
            password = "${artifactory_password}"
        }
    }
}
}


artifactoryPublish.skip = true

artifactory {
    contextUrl = "${artifactory_contextUrl}"
    publish {
        repository {
            repoKey = 'libs-release-local'
            username = "${artifactory_user}"
            password = "${artifactory_password}"
        }
        defaults {
            publications('aar')
            publishArtifacts = true
            properties = ['qa.level': 'basic', 'dev.team': 'core']
            publishPom = true
        }
    }
}

我的第二个问题是Artifactory Plugin上传了一些内容,我看到了这个日志条目:

Deploying build descriptor to: https://servername/artifactory/api/build
Build successfully deployed. Browse it in Artifactory under https://servername/artifactory/webapp/builds/eap-androidcore/1475772844540

在Artifactory Web UI上,我看到只有在“Build Browser”中上传的内容。没有列出模块,缺少* .aar文件。此外,在任何其他maven存储库中都不会生成任何POM。

publishing {
    publications {
        aar(MavenPublication) {
            groupId = 'com.example.core'
            artifactId project.name
            version = VERSION_NAME
            artifact "${project.buildDir}/build/outputs/aar/core_icons-debug.aar"
        }
    }
}

我几次检查了文件的路径,这是正确的。

那么为什么artifactory不上传.aar文件?

非常感谢您阅读/帮助我

0 个答案:

没有答案