Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I deploy just the sources jar from a maven project?

We made a number of releases to our nexus repository without source jars attached. I would like to backfill the source jars for these releases.

What I tried to do was

  1. checkout the tagged version that I wanted to upload sources for
  2. update the pom with the attach-sources snippet
  3. do a maven deploy

This failed with a 400 error code because the pom and artifact jar were already in the repository.

Is there any way to upload just the source jar?

like image 285
Caoilte Avatar asked Oct 31 '25 23:10

Caoilte


2 Answers

you should be able to do this using maven deploy-file (this has the added benefit of generating the various file sums as well), details here (you would be using, among other things, "packaging=jar" and "classifier=source").

like image 141
jtahlborn Avatar answered Nov 03 '25 14:11

jtahlborn


I think the simplest thing would be to just upload sources jar using 'curl'. You will not even need to make any changes for that.

like image 26
Alex Gitelman Avatar answered Nov 03 '25 13:11

Alex Gitelman



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!