clojars

2024-05-31T11:30:58.719789Z

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)

2024-05-31T11:31:08.016899Z

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]

2024-05-31T11:34:34.085959Z

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.

2024-05-31T12:03:12.283899Z

The same thing happens when I just run mvn deploy

2024-05-31T12:04:11.254489Z

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.

2024-05-31T12:07:31.335139Z

More details on the loss of the response message: https://github.com/clojars/clojars-web/issues/774

2024-05-31T13:15:39.481299Z

Thank you for the quick response, for taking the time to explain, and for a very workable solution. 🙏 😊

2024-05-31T13:22:41.304959Z

My pleasure! Apologies for the confusion!