【问题标题】:Gradle : Could not publish configuration archivesGradle:无法发布配置档案
【发布时间】:2016-01-07 17:49:00
【问题描述】:

我正在尝试将我的库发布到 jcenter。但是当我跑步时

gradlew install

我得到: 安装工件时出错https://github.com/vishnus1224/CircularProgressIndicator:library:aar:安装工件时出错:文件名、目录名或卷标语法不正确。

我的库在github上的位置是here

这是我的 build.gradle 文件

apply plugin: 'com.android.library'
apply plugin: 'com.github.dcendents.android-maven'
apply plugin: 'com.jfrog.bintray'
version = "1.0"

android {
compileSdkVersion 21
buildToolsVersion "23.0.1"

defaultConfig {
    minSdkVersion 11
    targetSdkVersion 21
    versionCode 1
    versionName version
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
       }
   }
}

def siteUrl = 'https://github.com/vishnus1224/CircularProgressIndicator'
def gitUrl = 'https://github.com/vishnus1224/CircularProgressIndicator.git'
group = "https://github.com/vishnus1224/CircularProgressIndicator"

install {
repositories.mavenInstaller {
    // This generates POM.xml with proper parameters
    pom {
        project {
            packaging 'aar'
            // Add your description here
            name 'Displays the progress in a circle with animation along with the progress percentage.'
            url siteUrl
            // Set your license
            licenses {
                license {
                    name 'MIT'
                    url 'http://opensource.org/licenses/MIT'
                }
            }
            developers {
                developer {
                    id 'vishnus1224'
                    name 'Vishnu Shirodker'
                    email 'vishnus1224@gmail.com'
                }
            }
            scm {
                connection gitUrl
                developerConnection gitUrl
                url siteUrl
               }
           }
       }
   }
}

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
}

Properties properties = new Properties()
        properties.load(project.rootProject.file('local.properties').newDataInputStre    am())

bintray {
user = properties.getProperty("bintray.user")
key = properties.getProperty("bintray.apikey")

configurations = ['archives']
pkg {
    repo = "maven"
    name = "CircularProgressIndicator"
    websiteUrl = siteUrl
    vcsUrl = gitUrl
    licenses = ["MIT"]
    publish = true
}
}

请帮忙。

更新:我要做的就是使用任何可能的方法将库推送到 jcenter。

【问题讨论】:

  • 查看this链接
  • 包装'aar'?你不是说罐子吗?
  • Github 上的代码似乎与上面的文件没有更新;会不会是您在其他评分器配置文件中有某些内容?
  • 另一个 gradle 文件用于示例项目。这是图书馆项目的主要项目。我已经按照这个教程virag.si/2015/01/publishing-gradle-android-library-to-jcenter

标签: android gradle android-gradle-plugin build.gradle jcenter


【解决方案1】:

【讨论】:

    猜你喜欢
    • 2023-04-04
    • 1970-01-01
    • 2023-03-05
    • 2022-09-23
    • 1970-01-01
    • 1970-01-01
    • 2015-07-31
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多