I am deploying using mvn , and now I am getting 403 forbidden when trying to upload maven-metadata.xml. I have checked my .m2/settings.xml and the corresponding deploy token. Any ideas? (error log in thread)
mvn deploy:deploy-file -Dfile=confair.jar -DrepositoryId=clojars -Durl= -DpomFile=pom.xml
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------< com.magnars:confair >-------------------------
[INFO] Building confair 2024.05.31
[INFO] from pom.xml
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- deploy:3.1.1:deploy-file (default-cli) @ confair ---
Uploading to clojars:
Uploaded to clojars: (4.6 kB at 1.5 kB/s)
Uploading to clojars:
Uploaded to clojars: (994 B at 457 B/s)
Downloading from clojars:
Downloaded from clojars: (610 B at 1.1 kB/s)
Uploading to clojars:
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 6.861 s
[INFO] Finished at: 2024-05-31T13:27:24+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:3.1.1:deploy-file (default-cli) on project confair: Failed to deploy metadata: Could not transfer metadata com.magnars:confair/maven-metadata.xml from/to clojars (): status code: 403, reason phrase: Forbidden (403) -> [Help 1] It's been a few years since I set this up, so I can no longer answer to why it's using this exact invocation, but I do know it has worked for 5 releases, the last one in 2022.
The same thing happens when I just run mvn deploy
Hi @magnars!
The short answer is you need to add a license to the pom (from the clojars logs: "the POM file does not include a license. See https://bit.ly/3PQunZU"). We started requiring licenses in December of last year.
The reason you don't see that message: we do validation on the entire deploy when the maven-metadata.xml is uploaded, as that is the only signal we have that the upload is done. We then return a reason phrase telling you when the validation failed. However, for a couple of releases, maven removed showing those custom reason phrases, so your mvn version may fall within that window.
More details on the loss of the response message: https://github.com/clojars/clojars-web/issues/774
Thank you for the quick response, for taking the time to explain, and for a very workable solution. 🙏 😊
My pleasure! Apologies for the confusion!