我正在尝试将我的库上传到JCenter Repository。我遵循了本教程:
https://www.virag.si/2015/01/publishing-gradle-android-library-to-jcenter/
运行gradlew bintrayUpload命令后,我的build.gradle库。
apply plugin: 'com.android.library'
apply plugin: 'com.github.dcendents.android-maven'
apply plugin: 'com.jfrog.bintray'
// This is the library version used when deploying the artifact
version = "1.0.0"
android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
defaultConfig {
minSdkVersion 8
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.0.0'
}
def siteUrl = 'https://github.com/vipulasri/Layout-to-Image'
def gitUrl = 'https://github.com/vipulasri/Layout-to-Image.git'
group = "com.github.vipulasri"
install {
repositories.mavenInstaller {
// This generates POM.xml with proper parameters
pom {
project {
packaging 'aar'
// Add your description here
name 'Layout to Image'
description = 'The project aims to convert your Android Layout Xml to Image'
url siteUrl
// Set your license
licenses {
license {
name 'The Apache Software License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id 'vipulasri'
name 'Vipul Asri'
email 'vipulasri.2007@gmail.com'
}
}
scm {
connection gitUrl
developerConnection gitUrl
url siteUrl
}
}
}
}
}
dependencies {
}
task sourcesJar(type: Jar) {
from android.sourceSets.main.java.srcDirs
classifier = 'sources'
}
task javadoc(type: Javadoc) {
source = android.sourceSets.main.java.srcDirs
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
artifacts {
archives javadocJar
archives sourcesJar
}
task findConventions << {
println project.getConvention()
}
Properties properties = new Properties()
properties.load(project.rootProject.file('local.properties').newDataInputStream())
bintray {
user = properties.getProperty("bintray.user")
key = properties.getProperty("bintray.apikey")
configurations = ['archives']
pkg {
repo = "maven"
// it is the name that appears in bintray when logged
name = "layouttoimage"
websiteUrl = siteUrl
vcsUrl = gitUrl
licenses = ['Apache-2.0']
publish = true
}
}
我收到以下错误:
Publications(s) specified but no publications exist in project :library.
:app:bintrayUpload FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Some problems were found with the configuration of task ':app:bintrayUpload'.
> No value has been specified for property 'packageName'.
> No value has been specified for property 'repoName'.
> No value has been specified for property 'apiKey'.
> No value has been specified for property 'user'.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED