问题
I'm trying to publish a jar library to bintray using Gradle. I have a package on my project which is "com.github.instagram". What I am trying to achieve is to build the jar file of this package and upload it to bintray.
here are my configurations
uploadArchives {
repositories {
bintrayMavenDeployer {
username 'xxx'
apiKey 'xxx'
repoOwner 'xxx'
repoName 'xxx'
packageName 'xxx'
description 'This is an example to simplifying bintray publishing'
descUrl 'https://github.com/ysb33r/Gradle/blob/master/bintray/README.md'
tags 'gradle','bintray'
}
}
}
but when i execute gradlew uploadArchives, it uploads the apk file instead of jar library file. how to instruct my gradle to compile only the package that I want and produce a jar file?
回答1:
Please use the dedicated gradle-bintray-plugin. The documentation include very detailed examples.
回答2:
After you've created a Bintray account, I suggest you try using the following two scripts to make working with the gradle-bintray-plugin easier.
https://raw.githubusercontent.com/attwellBrian/JCenter/master/installv1.gradle https://raw.githubusercontent.com/attwellBrian/JCenter/master/bintrayv1.gradle
Please read the tutorial on how to use these scripts.
The gradle-bintray-plugin is great. But its usage instructions at its GitHub page aren't straight forwards.
来源:https://stackoverflow.com/questions/27153034/publish-jar-library-to-bintray-using-gradle