Jitpack.io: Ability to download artifact's sources

Created on 9 Dec 2015  路  5Comments  路  Source: jitpack/jitpack.io

Hello.

As I can see my IDE is NOT able to download sources for artifact from JitPack.
And sometimes looking into sources can be very helpful.
BTW if I have sources with javadoc - then I can see this docs in while using auto completion.
Are you planning to implement such feature or not?

Regards.

enhancement

Most helpful comment

Can you please show how to correctly publish all project sources using Gradle in an Android library and in a Java/Kotlin library?
I'm trying to Google around it seems it's needed someting more then just a Maven plugin and most of the stuff is outdated.

All 5 comments

Hi Rumato

It is up to each individual project to publish sources and needs to be configured in the build file. For example, in gradle you would do: https://github.com/jitpack/gradle-simple/blob/master/build.gradle#L17-L20
If the project publishes sources.jar then it will be available in the IDE.
Completely agree with you that its useful but we can't always publish sources automatically. This is mainly because projects can have very different file layouts.

If someone has library that creates sources jar by finding source files then we'll be happy to add it

Don't you have the sources already? Since the jitpack.io docs mention a build step that happens inside your Docker boxes.
Now that I found the description of the build process, I see that it just runs the standard build tools and assumes that it can pick up the artifacts from the local Maven repo.
I wouldn't use a library that searches for source files. That's going to be a miserable heuristics-based thing. I thought about hooking into the build tool and picking up the source path from there, but that's going to fail for some more exotic builds, so that's too the heuristics route. That's stuff for later, when Jitpack has developer hours to spare. (Who _is_ "we", anyway? Right now, Jitpack has all the signs of a one-man show...)

FWIW for Jenkins plugins the following sufficed: https://github.com/jenkinsci/plugin-pom/pull/37

Can you please show how to correctly publish all project sources using Gradle in an Android library and in a Java/Kotlin library?
I'm trying to Google around it seems it's needed someting more then just a Maven plugin and most of the stuff is outdated.

Was this page helpful?
0 / 5 - 0 ratings