Welcome! Please see the About page for a little more info on how this works.

0 votes
in tools.deps by
The {{:mvn/repos}} map in deps.edn currently allows the user to specify the id and url of external repositories, but it doesn't allow any customization of [any other settings|http://maven.apache.org/pom.html#Repositories]. I would specifically like to be able to disable the {{<snapshots>}} repository, and to set {{<updatePolicy>}} to {{never}} in either or both of the snapshot/release repositories.

There is a small amount of earlier discussion in [TDEPS-97].

Just to make this a little more concrete, here is what I imagine this section of deps.edn might look like:


 :mvn/repos
 {"my-repo"
  {:url "s3p://my-bucket/maven/"
   :releases {:update-policy "never"}
   :snapshots {:enabled false}}}


Alternately, a simpler but less typesafe version could just use a string-to-string map for the snapshot/releases section:


 :mvn/repos
 {"my-repo"
  {:url "s3p://my-bucket/maven/"
   :releases {"updatePolicy" "never"}
   :snapshots {"enabled" "false"}}}

3 Answers

0 votes
by

Comment made by: timgilbert

Maven was giving me some warnings because one section of the pom.xml contains duplicate entries; {{0001-Removing-duplicate-entry-from-pom.xml.patch}} removes them (this is independent from the patch or the ticket, really).

0 votes
by

Comment made by: timgilbert

{{0002-Implemented-snapshots-and-releases-configuration.patch}} implements <snapshots> and <releases> configuration under the {{:mvn/repos}} key in deps.edn.

This implementation follows the first example above, where {{:releases}} contains a map which can contain {{:update-policy}}, {{:checksum-policy}} or {{:enabled}} keys.

I've also added some rudimentary tests for the pom-generation stuff, or at least the repo part of it. They cheat a little bit by testing private functions in the {{gen.pom}} namespace, and they work by doing brute string comparisons on generated XML, but they are at least easy to read. I'm happy to rework them to be more correct / robust if needed.

If this format looks good, I can submit a PR against the clojure-site repo to update the tools.deps docs to mention these new keys.

0 votes
by
Reference: https://clojure.atlassian.net/browse/TDEPS-101 (reported by timgilbert)
...