Note on tools.build
I could not find the usage of :src-pom.
It's unclear which attributes the src-pom file can have, which it cannot, and which will be overwritten.
:src-pom - source pom.xml to synchronize from, default = "./pom.xml"
may be :none to ignore any existing pom.xml file
A string -- a file path.
Are you thinking of :pom-data perhaps?:pom-data - vector of hiccup-style extra pom top elements to include when
:src-pom is :none or the source pom.xml does not exist:
[[:licenses
[:license
[:name "Eclipse Public License 1.0"]
[:url " ";]
[:distribution "repo"]]]
[:organization "Super Corp"]]
The pom-data MUST NOT include:
:modelVersion, :packaging, :groupId, :artifactId, :version, :name,
:deps, :repositories, :build, or :scm
Both of those are from the docstring / API docs.API docs: https://clojure.github.io/tools.build/clojure.tools.build.api.html#var-write-pom
Yes, I know that it is a string to a pom.xml file - but there are no mentions of the content or restrictions of this pom - or even a minimal example
It's a standard pom.xml file with as much or as little detail in it as you want to provide. I guess you'd have to read the Maven docs since it's a Maven standard document?
I don't use :src-pom, now that we have :pom-data, since it's tedious to write XML by hand and there are caveats about having pom.xml in your GH repo (you really need it in a subfolder, not in the root, to avoid Maven-based tooling from making incorrect assumptions about your (template) pom.xml.
https://clojure-doc.org/articles/cookbooks/cli_build_projects/#the-generated-pomxml-file shows the :pom-data approach and why you would want to go that way instead.
Looking at the code, I was able to understand:
• all deps in dependencies will be replaced - I'd say that 'src-pom should not have dependencies key' or something like it.
In any case, in the official documentation, which discusses various uses, this attribute isn't even mentioned – I think it should be.
I'm not having any problems using tools.build - I'm making advanced use of it - and I realized that this part is poorly documented.
I don't think :src-pom should be mentioned -- it was the original way to deal with generating a full pom.xml file but it is kind of legacy now and a lot less convenient than using :pom-data.
I only just noticed that the tools.build guide -- which is very superficial -- links to the clojure-doc article I linked above and to another page on clojure-doc https://clojure-doc.org/articles/ecosystem/libraries_authoring/ -- so I guess those are considered the tools.build Reference Docs now 😄
"Guides" on http://clojure.org tend to be very surface level and don't go deep into any of the options. The assumption is that you'll either consult the API docs or some Reference Docs for more detail.
The docstring does mention it and say which parts are replaced?
The size of even a small pom.xml are too much to fit in a docstring example
I think the OP doesn't know what a pom.xml file can contain -- which is a Maven docs issue, not a Clojure docs issue.