我在项目中创建了一个新的Android库模块作为测试库.它是一个简单的模块,其中一个类具有一个返回字符串的静态方法.我有Artifactory服务器在本地运行,并希望将我的Android lib /模块推送到它.我从Artifactory Web界面生成了Gradle脚本和gradle属性.我的testLib模块中的build.gradle现在看起来像这样:
apply plugin: 'com.android.library'
android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
defaultConfig {
minSdkVersion 14
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'),'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs',include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.2.1'
}
/////
buildscript {
repositories {
maven {
url 'http://localhost:8081/artifactory/plugins-release'
credentials {
username = "${artifactory_user}"
password = "${artifactory_password}"
}
}
}
dependencies {
//Check for the latest version here: http://plugins.gradle.org/plugin/com.jfrog.artifactory
classpath "org.jfrog.buildinfo:build-info-extractor-gradle:3.1.1"
}
}
allprojects {
apply plugin: "com.jfrog.artifactory"
}
artifactory {
contextUrl = "${artifactory_contextUrl}" //The base Artifactory URL if not overridden by the publisher/resolver
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
}
}
}
在我添加之后,我运行了./gradlew artifactoryPublish命令.它说BUILD成功.然后我去神器网页应用程序到存储库浏览器,我看看libs-release-local,它的工件数为0.我做错了什么?
最佳答案
原文链接:https://www.f2er.com/android/431316.html