Dec 27, 2010

Create a project using Clojure.

First of all you need to install Clojure leiningen environment.
You can install it from the website - https://github.com/technomancy/leiningen

Then you need to run
lien new ui_project

This will create a project directory call ui_project. Inside that you will see some files like project.clj src/ui/core.clj.

Then you must edit the project.clj file and add main class. It will be like  " :main ui.core" and you can add dependencies as in maven. You can create a pom.xml but first you need to add all dependencies in the project.clj file. After that it will be like this.

If the pom dependency is like this;
    <dependency>
      <groupId>group.id</groupId>
      <artifactId>artifact</artifactId>
      <version>1.0.0</version>
    </dependency>


(defproject ui "1.0.0-SNAPSHOT"
  :description "FIXME: write"
  :dependencies [[org.clojure/clojure "1.2.0"]
                 [org.clojure/clojure-contrib "1.2.0"]
                 [group.id/artifact "1.0.0"]]
  :main ui.core)

Then you can use maven also.

No comments:

Post a Comment

Your comments are always welcome ...