Skip to content
This repository has been archived by the owner on Feb 11, 2022. It is now read-only.

can not create javadoc.jar and sources.jar #90

Closed
yilylong opened this issue Jun 24, 2016 · 8 comments
Closed

can not create javadoc.jar and sources.jar #90

yilylong opened this issue Jun 24, 2016 · 8 comments

Comments

@yilylong
Copy link

Skipping upload for missing file 'E:\MyAndroidSudioProgects\CBPullRefreshListView\CBPullRefresh\build\libs\CBPullRefresh-sources.jar'
Skipping upload for missing file 'E:\MyAndroidSudioProgects\CBPullRefreshListView\CBPullRefresh\build\libs\CBPullRefresh-javadoc.jar'.

@xrigau
Copy link
Contributor

xrigau commented Sep 9, 2016

Did you check the files E:\MyAndroidSudioProgects\CBPullRefreshListView\CBPullRefresh\build\libs\CBPullRefresh-sources.jar E:\MyAndroidSudioProgects\CBPullRefreshListView\CBPullRefresh\build\libs\CBPullRefresh-javadoc.jar exist?

@chenhui3014
Copy link

How to solve this problem?

@amatkivskiy
Copy link

@xrigau @chenhui3014 @yilylong To fix this issue you need to add the following lines to your build.gradle

// custom tasks for creating source/javadoc jars
task sourcesJar(type: Jar, dependsOn: classes) {
    classifier = 'sources'
    from sourceSets.main.allSource
}

task javadocJar(type: Jar, dependsOn: javadoc) {
    classifier = 'javadoc'
    from javadoc.destinationDir
}

// add javadoc/source jar tasks as artifacts
artifacts {
    archives sourcesJar, javadocJar
}

amatkivskiy added a commit to Gitteroid/GitterJavaSDK that referenced this issue Jan 14, 2017
@kuyue
Copy link

kuyue commented Jun 26, 2017

you can execute the two tasks:
image

@kkmike999
Copy link

add three more task releaseAndroidJavadocs,releaseAndroidJavadocsJar,releaseAndroidSourcesJar .

the total commend :

./gradlew clean build releaseAndroidJavadocs releaseAndroidJavadocsJar releaseAndroidSourcesJar generatePomFileForReleasePublication bintrayUpload -PbintrayUser=<bintray user> -PbintrayKey=<bintray api key> -PdryRun=false 

@sunxu3074
Copy link

I solved it by using gradle-android-library , Hahahaha

@blueberryCoder
Copy link

I met this problem too.

I solve it by delete this configs in gradle.properties

#org.gradle.daemon=false
#org.gradle.jvmargs=-Dfile.encoding=UTF-8 -Xmx1536m
#org.gradle.configureondemand=true

@zhangpfan
Copy link

//生成源文件
task sourcesJar(type: Jar) {
from android.sourceSets.main.java.srcDirs
classifier = 'sources'
}

//生成Javadoc文档
task javadoc(type: Javadoc) {
source = android.sourceSets.main.java.srcDirs
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
}

//文档打包成jar
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}

//拷贝javadoc文件
task copyDoc(type: Copy) {
from "${buildDir}/docs/"
into "docs"
}

//上传到JCenter所需要的源码文件
artifacts {
archives javadocJar
archives sourcesJar
}

//添加下面这句
apply plugin: 'com.novoda.bintray-release'

publish {
userOrg = '' //注册时候的用户名
groupId = '
'// //compile引用时的第1部分
repoName = 'Maven'//要传到的maven的名字。你可能有多个maven,要传哪个写哪个
artifactId = '
***'////发布到JCenter上的项目名字,compile引用时的第2部分项目名
publishVersion = '1.0.1'//版本号 ,compile引用时的最后部分,下次更新是只需要更改版本号即可
desc = 'A customizable Lib on Android'//描述,不重要
website = 'https://github.com/skypfan' //项目的GitHub网站
}

// gradlew clean build generatePomFileForReleasePublication bintrayUpload -PbintrayUser=-PbintrayKey=-PdryRun=false

此配置可以解决sources.jar、javadoc.jar以及pom.xml文件缺失的问题

yagi2 pushed a commit to seesaa/awesomedialogfragment-android that referenced this issue Apr 11, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants