- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试将我的库发布到 bintray。但是创建的jar文件只包含一个META-INF文件夹,没有类文件。
我已按照 https://github.com/bintray/gradle-bintray-plugin#readme 的指南进行操作但无法让它工作。
这就是我的 gradle 文件的样子。
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
plugins {
id "com.jfrog.bintray" version "1.7"
}
apply plugin: 'maven-publish'
apply plugin: 'java'
allprojects {
repositories {
jcenter()
}
}
publishing {
publications {
MyPublication(MavenPublication) {
from components.java
groupId ''
artifactId ''
version '1.0'
}
}
}
bintray {
user = ''
key = ''
publications = ['MyPublication']
pkg {
repo = 'maven'
name = ''
desc = ''
licenses = ['Apache-2.0']
websiteUrl = ''
vcsUrl = ''
version {
name = '1.0'
vcsTag = '1.0'
released = new Date()
attributes = ['gradle-plugin': 'com.use.less:com.use.less.gradle:gradle-useless-plugin']
}
}
}
最佳答案
我设法修复它。
最大的不同是我在推送到 bintray 时使用了配置而不是出版物。下面是我为它设置的 gradle 文件。
然后只需运行 gradlew bintrayUpload。我收到了一些我无法修复的错误消息,但它们没有必要修复,因为它无论如何都可以上传。
在根 build.gradle
plugins {
id "com.jfrog.bintray" version "1.7"
id "com.github.dcendents.android-maven" version "1.5"
}
// bintrayUpload config
apply from: 'bintray-publish.gradle'
apply plugin: 'com.github.dcendents.android-maven'
apply plugin: 'com.jfrog.bintray'
// Maven group id and version for the artifact
group = LIB_GROUP_ID
version = LIB_VERSION
install {
repositories.mavenInstaller {
// This generates POM.xml with proper parameters
pom {
project {
packaging POM_PACKAGING
groupId LIB_GROUP_ID
artifactId LIB_ARTIFACT_ID
name LIB_NAME
description LIB_DESCRIPTION
url LIB_URL
developers {
developer {
id POM_DEVELOPER_ID
name POM_DEVELOPER_NAME
}
}
scm {
url POM_SCM_URL
connection POM_SCM_CONNECTION
developerConnection POM_SCM_DEV_CONNECTION
}
licenses {
license {
name POM_LICENCE_NAME
url POM_LICENCE_URL
distribution POM_LICENCE_DIST
}
}
}
}
}
}
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 {
// TODO: Java doc generates errors for some reason, disable for now
//archives javadocJar
archives sourcesJar
}
Properties properties = new Properties()
properties.load(project.rootProject.file('local.properties').newDataInputStream())
bintray {
user = POM_DEVELOPER_ID
key = properties.getProperty("bintray.apikey")
configurations = ['archives']
pkg {
repo = 'maven'
name = BIN_TRAY_NAME
desc = LIB_DESCRIPTION
licenses = ['Apache-2.0']
websiteUrl = LIB_URL
vcsUrl = LIB_VCS_URL
publish = true
dryRun = false
version {
name = LIB_VERSION
desc = LIB_DESCRIPTION
released = new Date()
}
}
}
BIN_TRAY_NAME = MyLib
LIB_VERSION = 1.0.0
LIB_GROUP_ID = com.xxx.mylib
# The artifact name should be the same as the library module name
LIB_ARTIFACT_ID = mylib
LIB_NAME = MyLib
LIB_DESCRIPTION = My desc
LIB_URL = https://github.com/xxx/mylib
LIB_VCS_URL = https://github.com/xxx/mylib.git
POM_DEVELOPER_ID = My bintray id
POM_DEVELOPER_NAME = My bintray name
POM_SCM_URL = scm:git@github.com/xxx/mylib.git
POM_SCM_CONNECTION = scm:git@github.com/xxx/mylib.git
POM_SCM_DEV_CONNECTION = scm:git@github.com/xxx/mylib.git
POM_LICENCE_NAME = The Apache Software License, Version 2.0
POM_LICENCE_URL = http://www.apache.org/licenses/LICENSE-2.0.txt
POM_LICENCE_DIST=repo
POM_PACKAGING = aar
关于android - jar 文件在 bintrayUpload 后不包含类文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39919320/
我在运行 gradlew install 时遇到以下错误。 Failed to capture snapshot of input files for task 'javadoc' during up
我正在尝试将我的库发布到 bintray。但是创建的jar文件只包含一个META-INF文件夹,没有类文件。 我已按照 https://github.com/bintray/gradle-bintra
我正在尝试从 .proto 自动生成和部署 Java 库- 文件。第一部分,从我的.proto生成Java源代码-files 已经可以工作,并且 Jar 任务生成三个 .jar -文件:example
我正在学习本教程 https://antoniocappiello.com/2015/11/11/publish-your-library-to-jcenter-in-3-steps/发布我的第一个库
我想将我的图书馆上传到 jecenter。我已经创建了 bintray 帐户等并遵循了此处提到的所有步骤。 我在我的应用程序模块和库模块中做了以下更改。 //库build.gradle apply p
我遵循了将我的 AAR 文件发布到 JCenter 所需的每个步骤,然后使用 https://github.com/danielemaddaluno/gradle-jcenter-publish 将其
在更新gradle和android studio之前,我曾使用tutorial的这些任务将我的库上载到Bintray: 第一:gradlew install 第二个:gradlew bintrayUp
我正在尝试将 Android 库发布到 jcenter。我关注了https://github.com/danielemaddaluno/gradle-jcenter-publish教程。在我尝试执行之
我很长一段时间都面临这个错误: Execution failed for task ':lib-change-scene:bintrayUpload'. Could not create packag
我正在尝试将我的库上传到 jCenter。我正在学习本教程: http://inthecheesefactory.com/blog/how-to-upload-library-to-jcenter-m
我的版本有什么问题? bintray.gradle apply plugin: 'com.jfrog.bintray' version = '0.1' task sourcesJar(type: Ja
我正在开发一个 android 库项目。我想将我的库上传到 JCenter。我已经创建了 bintray 帐户等并遵循了所有提到的步骤 here . 我在我的应用程序模块和库模块中做了以下更改。 应用
我是一名优秀的程序员,十分优秀!