5

I use the $ lein pom command to genereate a maven pom.xml from a Leiningen project.clj file. I do that because I have Java source files in my Clojure project.

I would like to make sure the following maven properties are embedded into the generated pom.xml file:

<properties>
   <maven.compiler.source>1.7</maven.compiler.source>
   <maven.compiler.target>1.7</maven.compiler.target>
</properties>

I do this by hand now. However, I do not want to check in the generated file into version control and I would like to be able to regenerate it any time. How can I make Leiningen to embed the maven properties in the generated pom.xml file every time I generate the pom.xml?

Thank you

erdos
  • 3,135
  • 2
  • 16
  • 27
  • Why you don't want to compile Java with lein as well? – Alex Ott Nov 01 '17 at 09:49
  • i use lein to compile java. but it turned out my java IDE only supports maven projects not lein projects, so i generate a pom.xml before opening the project in the editor. – erdos Nov 01 '17 at 11:32

1 Answers1

5

You can add custom pom.xml entries using :pom-addition:

(defproject ...
  ...
  :pom-addition [:properties
                  ["maven.compiler.source" "1.7"]
                  ["maven.compiler.target" "1.7"]])
David Ongaro
  • 3,568
  • 1
  • 24
  • 36
Piotrek Bzdyl
  • 12,965
  • 1
  • 31
  • 49