Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Leiningen: How to set Maven groupId and packaging properties in project.clj

I have a Clojure project that I would like to package and use in one of my Java projects that uses Maven.

When I generate a pom.xml file using Leiningen, it sets the groupId to artifactId, but I need the groupId to be the same as my parent Java project.

Also, I would like to be able to specify the packaging type in the pom.xml to be jar

In short: how do I set the groupId and packaging properties in project.clj to generate a pom.xml containing those properties?

like image 218
mchlstckl Avatar asked Oct 21 '11 13:10

mchlstckl


1 Answers

Leiningen uses the groupId/artifactId naming convention to distinguish between the two entities. Look at the sample project.clj to see how it's done. When running lein pom groupId and artifactId will be then properly resolved.

Sample snippet from the linked project.clj:

;; The project is named "sample", and its group-id is "org.example".
(defproject org.example/sample "1.0.0-SNAPSHOT" ; version "1.0.0-SNAPSHOT"
;; ...

EDIT: I missed the question about packaging. AFAICS you can't specify the packaging property in project.clj.

like image 86
skuro Avatar answered Nov 18 '22 07:11

skuro