Fork me on GitHub
#leiningen
<
2019-05-22
>
richiardiandrea18:05:37

hello folks! is there a plugin for lein that reads the dependencies from pom.xml instead of :dependencies?

mikerod19:05:51

@richiardiandrea I don’t know of one, but would be a bit complex potentially to if the pom.xml had things like a parent and/or inheritance happening

mikerod19:05:23

along with <dependencyManagement> of versions etc - seems like you’d have to run mvn to get the list of dependencies - not just like parse an xml

mikerod19:05:46

In a way, this is similar to how you can’t always just read the edn of lein project.clj, since there is profile merging, middleware, and plugins involved to get dependencies

richiardiandrea19:05:43

yeah right, but assuming the pom.xml is simple enough...I haven't seen any plugin that does that, it might not exist then

richiardiandrea19:05:59

just don't want to manually sync the two 😄

mikerod19:05:06

if it’s really simple. Yeah I don’t know of one. I’ve done something similar by just parsing the pom.xml before though

richiardiandrea19:05:07

I found this, it might be useful, I am going to try that: https://gist.github.com/fogus/1990419

mikerod19:05:25

yeah, looks on the right track

mikerod19:05:05

it hasn’t been worked on in a long time

mikerod19:05:21

but I remember looking at it a bit when I was trying to get info from pom’s for lein

pyr19:05:40

Is it possible to parameterize the SCM url based on env vars

pyr19:05:03

my use case is that I need to wire credentials to git within Jenkins

pyr19:05:10

so lein release could work from there

mikerod19:05:53

@pyr should be able to with using the eval-syntax of defproject

mikerod19:05:39

(def scm (determine-scm))

(defproject my/project "1.0"...
   :scm ~scm ...)

mikerod19:05:51

I think using dispatch macro read-eval is ok too (maybe the ~ is deprecated if I recall correctly) #=(determine-scm)