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

0 votes
in tools.deps by

I have a user-level deps.edn and a project-level deps.edn. I want to generate a pom.xml file for my project that ignores any dependencies in my user-level deps.edn. The command I have now is:

clj -Srepro -X:deps mvn-pom

According to the docs (and to the report provided by -Sverbose), this should ignore my user-level deps.edn. But I still see the dependencies from my user deps.edn appearing in the generated pom.xml! I've tried this with -Sforce also and nothing changed. Whether I use -Spom or -X:deps mvn-pom, it seems like the -Srepro option is ignored.

Here's more info about my environment:

$ clj -Srepro -Sverbose -Sdescribe
version      = 1.10.1.697
install_dir  = /usr/local/Cellar/clojure/1.10.1.697
config_dir   = /Users/jming/.clojure
config_paths = /usr/local/Cellar/clojure/1.10.1.697/deps.edn deps.edn
cache_dir    = .cpcache
cp_file      = .cpcache/1655984260.cp

{:version "1.10.1.697"
 :config-files ["/usr/local/Cellar/clojure/1.10.1.697/deps.edn" "deps.edn" ]
 :config-user ""
 :config-project "deps.edn"
 :install-dir "/usr/local/Cellar/clojure/1.10.1.697"
 :config-dir "/Users/jming/.clojure"
 :cache-dir ".cpcache"
 :force false
 :repro true
 :main-aliases ""
 :repl-aliases ""}

What am I doing wrong? Why does -Srepro appear to be doing nothing, despite what -Sverbose says? How can I keep user-level dev dependencies like cljfmt out of my pom.xml?

1 Answer

+2 votes
by
selected by
 
Best answer

The mvn-pom program is being run by clj and the classpath modifier options for clj will affect the classpath for the mvn-pom program itself, not the dependency set represented in the generated pom.xml.

This is different from the -Spom option where clj and tools.deps work in tandem to convey the classpath context from clj to the pom generation such that classpath modifiers pass to clj affect the pom generation.

This is a known gap and we are still deciding on the best way to convey classpath modifier options to the mvn-pom program (there are several options). If this requirement is important to you at this moment, I'd recommend using -Spom for now.

by
That makes sense; thanks!
...