Converting project.clj to maven's pom.xml

2,829 views
Skip to first unread message

Murtaza Husain

unread,
Apr 20, 2012, 12:22:20 PM4/20/12
to clo...@googlegroups.com
Hi,

Is there any way to convert project.clj to pom.xml.

I was looking at jelastic which is a cloud provider for java, and they allow deploying projects from git repos which are compatible with maven 3. It will download the code and build it based on the maven config.

Anyway we can leverage that? 

Thanks,
Murtaza

Baishampayan Ghose

unread,
Apr 20, 2012, 2:31:51 PM4/20/12
to clo...@googlegroups.com

$ lein pom

Sent from phone, please excuse brevity.

--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clo...@googlegroups.com
Note that posts from new members are moderated - please be patient with your first post.
To unsubscribe from this group, send email to
clojure+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Timothy Baldridge

unread,
Apr 20, 2012, 3:19:06 PM4/20/12
to clo...@googlegroups.com

Try

lein pom

--

Ben Smith-Mannschott

unread,
Apr 20, 2012, 4:46:09 PM4/20/12
to clo...@googlegroups.com
"lein pom" may not do all you need. It depends on what you are trying
to accomplish.

It will generate a pom.xml which identifies your project (artifactId,
groupId, version, packaging) and lists its dependencies. This pom is
suitable for publishing your artifacts to some Maven repository for
others to consume. (That appears to be stated purpose of 'lein pom':
"Write a pom.xml file to disk for Maven interoperability.")

It does't configure clojure-maven-plugin, so executing 'mvn package'
with the resulting pom will not produce a useful result.

// ben

Phil Hagelberg

unread,
Apr 20, 2012, 4:48:22 PM4/20/12
to clo...@googlegroups.com
On Fri, Apr 20, 2012 at 1:46 PM, Ben Smith-Mannschott
<bsmit...@gmail.com> wrote:
> It will generate a pom.xml which identifies your project (artifactId,
> groupId, version, packaging) and lists its dependencies. This pom is
> suitable for publishing your artifacts to some Maven repository for
> others to consume. (That appears to be stated purpose of 'lein pom':
> "Write a pom.xml file to disk for Maven interoperability.")
>
> It does't configure clojure-maven-plugin, so executing 'mvn package'
> with the resulting pom will not produce a useful result.

We are discussing adding the ability to specify other things like plugins:

https://github.com/technomancy/leiningen/pull/454

Feel free to weigh in or spike out an implementation if this is
something you're interested in.

-Phil

Murtaza Husain

unread,
Apr 20, 2012, 9:52:01 PM4/20/12
to clo...@googlegroups.com

Hi,

Thanks for the answers, they are quite helpful.

What I would like to do is this -

1) Use leiningen for development purposes. 

2) Gnenerate a pom while pushing to git.

3) Th pom should be good enough so that it can be used by cloud evironments ( http://jelastic.com/docs/maven-cloud-hosting-in-jelastic) for building and deploying as a war. 

So is the above scenario possible if I just execute lein pom before pushing into git ? Or would using the clojure-maven plugin reolve this? If so is there a way to interop between both lein and clojure-maven, so that I can develop in one and deploy in another ?

Thanks,
Murtaza

Phil Hagelberg

unread,
Apr 20, 2012, 10:42:48 PM4/20/12
to clo...@googlegroups.com
On Fri, Apr 20, 2012 at 6:52 PM, Murtaza Husain
<murtaza...@sevenolives.com> wrote:
> 3) Th pom should be good enough so that it can be used by cloud evironments
> ( http://jelastic.com/docs/maven-cloud-hosting-in-jelastic) for building and
> deploying as a war.
>
> So is the above scenario possible if I just execute lein pom before pushing
> into git?

It might work once Leiningen's issue #454 is fixed, but it's hard to
say without knowing the specifics of what jelastic requires in the
pom.

-Phil

Mark Derricutt

unread,
Jun 7, 2012, 12:20:19 AM6/7/12
to clo...@googlegroups.com
Maybe I should write a lein plugin that generates a pom for my maven
plugin - but that feels a little rude :)

Mark

Joseph Smith

unread,
Jun 7, 2012, 5:52:04 PM6/7/12
to clo...@googlegroups.com
Doesn't "lein pom" do it?

---
Joseph Smith
j...@uwcreations.com
(402)601-5443

Phil Hagelberg

unread,
Jun 7, 2012, 5:53:40 PM6/7/12
to clo...@googlegroups.com
On Thu, Jun 7, 2012 at 2:52 PM, Joseph Smith <j...@uwcreations.com> wrote:
> Doesn't "lein pom" do it?

Not yet, but it's planned: https://github.com/technomancy/leiningen/pull/454

Happy to take a patch for it.

-Phil

Ryan Berdeen

unread,
Aug 25, 2013, 5:26:07 PM8/25/13
to clo...@googlegroups.com
Now that https://github.com/technomancy/leiningen/pull/454 is resolved, what's the right way to have lein generate a pom.xml that Maven can build? 

Is https://github.com/pallet/zi the way to go? How do I configure my project.clj so that it adds the plugin to the pom's <build> section, instead of adding a second <build>?

Thanks!

Ryan
Reply all
Reply to author
Forward
0 new messages