Skip to content

Commit

Permalink
Merge pull request technomancy#1324 from dominikdz/master
Browse files Browse the repository at this point in the history
Added support of maven <plugin> in pom.xml (pom-plugin tag)
  • Loading branch information
technomancy committed Oct 4, 2013
2 parents a4a027c + bac42c7 commit 4d211a2
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
6 changes: 6 additions & 0 deletions sample.project.clj
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,12 @@
;; Extensions here will be propagated to the pom but not used by Leiningen.
:extensions [[org.apache.maven.wagon/wagon-webdav "1.0-beta-2"]
[foo/bar-baz "1.0"]]

;; Plugins here will be propagated to the pom but not used by Leiningen.
:pom-plugins [[com.theoryinpractise/clojure-maven-plugin "1.3.13"
[:configuration [:sourceDirectories [:sourceDirectory "src"]]]]
[org.apache.tomcat.maven/tomcat7-maven-plugin "2.1"]]

;; Include <scm> tag in generated pom.xml file. All key/value pairs
;; appear exactly as configured. If absent, Leiningen will try to
;; use information from a .git directory.
Expand Down
15 changes: 13 additions & 2 deletions src/leiningen/pom.clj
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,19 @@
[:version version]]))))
[:directory (:target-path project)]
[:outputDirectory (:compile-path project)]
[:plugins
(if-let [plugins (seq (:pom-plugins project))]
(for [[dep version configuration] plugins]
[:plugin
[:groupId (or (namespace dep) (name dep))]
[:artifactId (name dep)]
[:version version]
;place for maven configuration tag
[:configuration configuration]
]
))

(if (or (seq extra-src) (seq extra-test))
[:plugins
[:plugin
[:groupId "org.codehaus.mojo"]
[:artifactId "build-helper-maven-plugin"]
Expand All @@ -258,7 +269,7 @@
[:goals [:goal "add-test-source"]]
[:configuration
(vec (concat [:sources]
(map (fn [x] [:source x]) extra-test)))]])]]])])))
(map (fn [x] [:source x]) extra-test)))]])]])]])))

(defmethod xml-tags ::parent
([_ [dep version & opts]]
Expand Down

0 comments on commit 4d211a2

Please sign in to comment.