kagkarlsson / db-scheduler

Persistent cluster-friendly scheduler for Java
Apache License 2.0
1.23k stars 188 forks source link

sources-jar lacks source code on jitpack.io #493

Open fsudau opened 3 months ago

fsudau commented 3 months ago

Bug Description

Hi, I noticed that the db-scheduler-14.0.0-sources.jar from jitpack.io does not actually contain the sources (it only contains sources of two shaded dependencies). However, the sources-jar from the official repo contains the sources as expected.

This can be a bit annoying since maven does not really allow you to specify which dependency to load from which repository. Once jitpack is listed as one of your repositories, chances are maven will load the sources-jar from there and db-scheduler's source code will not load into your IDE automatically.

Background

Looking into this, I noticed that jitpack relies on a very proactive approach: Once someone uses your library for the first time, they will checkout your code and build it for their repo. They have a log of the build available here. As evident from the log, they just run mvn clean install -DskipTests and store the resulting jars. The install command does indeed generate a sources-jar that does not contain the sources. I assume this has to do with the shade-plugin and how it interacts with the other plugins.

Severity

This is of course very specific (aka minor), but if someone could optimize the maven lifecycles so that the sources-build works for both repositories, I am sure this will save some developers some time in the future :)