Fork me on GitHub
#tools-build
<
2023-10-06
>
seancorfield20:10:14

Any reason for: > The pom-data MUST NOT include: > :modelVersion, :packaging, :groupId, :artifactId, :version, :name, > :deps, :repositories, :build, or :scm as opposed to just overriding them with generated content? (or the specified :scm option if also present)

Alex Miller (Clojure team)21:10:53

those are being generated by other parts of write-pom

Alex Miller (Clojure team)21:10:38

so use the existing features, add stuff if you need

seancorfield21:10:57

Specifying [[:scm ..]] in :pom-data (instead of via :scm) works -- if you provide :scm as well you get two <scm> sections (which makes sense). I think I'd prefer to specify as much of the "other" pom.xml stuff as possible via that Hiccup-style :pom-data and avoid using a template POM altogether at this point 🙂

Alex Miller (Clojure team)21:10:24

let me know how it goes :)

seancorfield21:10:04

I just don't want to find myself in a situation where I am passing [:scm ..] via :pom-data and a later version of tools.build snatches that away from me 🙂

Alex Miller (Clojure team)21:10:07

note that this does not work if you supply a template, only when generating new

seancorfield21:10:36

Right -- and I'd like to get rid of the templates in my projects. I think :pom-data is a great addition BTW!

seancorfield22:10:30

This works really nicely:

(defn- pom-template [version]
  [[:description "The next generation of clojure.java.jdbc: a new low-level Clojure wrapper for JDBC-based access to databases."]
   [:url ""]
   [:licenses
    [:license
     [:name "Eclipse Public License"]
     [:url ""]]]
   [:developers
    [:developer
     [:name "Sean Corfield"]]]
   [:scm
    [:url ""]
    [:connection "scm:git:"]
    [:developerConnection "scm:git:"]
    [:tag (str "v" version)]]])
and
:pom-data (pom-template version)
in my b/write-pom call. Nice! And this uncovered a bug in my project setup/build: it seems when you have a :src-pom template, b/write-pom does not add <packaging> but if you use :pom-data as above, it does add <packaging> -- is that "expected" @alexmiller?

Alex Miller (Clojure team)22:10:38

Shouldn’t it be in the template if you have a src pom?

seancorfield22:10:53

Well, yeah, that was my bug.

Alex Miller (Clojure team)22:10:57

It’s the default anyways, so not critical

seancorfield22:10:16

I had just never noticed it wasn't in the generated pom.xml file before 🙂

seancorfield22:10:49

This is so much nicer than having a :src-pom template in the repo! Thank you!

seancorfield22:10:30

This works really nicely:

(defn- pom-template [version]
  [[:description "The next generation of clojure.java.jdbc: a new low-level Clojure wrapper for JDBC-based access to databases."]
   [:url ""]
   [:licenses
    [:license
     [:name "Eclipse Public License"]
     [:url ""]]]
   [:developers
    [:developer
     [:name "Sean Corfield"]]]
   [:scm
    [:url ""]
    [:connection "scm:git:"]
    [:developerConnection "scm:git:"]
    [:tag (str "v" version)]]])
and
:pom-data (pom-template version)
in my b/write-pom call. Nice! And this uncovered a bug in my project setup/build: it seems when you have a :src-pom template, b/write-pom does not add <packaging> but if you use :pom-data as above, it does add <packaging> -- is that "expected" @alexmiller?