Maven and Clojure

by 1/17/2010 10:49:00 PM 0 comments

Maven and Clojure

I'm trying to setup a Maven build for a Clojure project. I'm playing around with Incanter and need to a) package up the project and b) have easy REPL interaction. The following POM seems to be working so far:
<project 
  xmlns="http://maven.apache.org/POM/4.0.0"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
    http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>org.mbari</groupId>
    <artifactId>clojuretest</artifactId>
    <packaging>jar</packaging>
    <version>1.0-SNAPSHOT</version>
    <name>clojuretest [library]</name>
    <url>http://maven.apache.org</url>
    
    <!-- 
        Combining info from:
            Packaging: http://pupeno.com/blog/how-to-create-a-clojure-application/
            Command line integration: http://github.com/talios/clojure-maven-plugin
    -->
            
    <build>
        <resources>
            <resource>
                <directory>src/main/clojure</directory>
            </resource>
        </resources>

        <plugins>
            <!-- Filter resources using UTF-8 encoding -->
            <plugin>
                <artifactId>maven-resources-plugin</artifactId>
                <configuration>
                    <encoding>UTF-8</encoding>
                </configuration>
            </plugin>
            <!-- Creates executable jar -->
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>appassembler-maven-plugin</artifactId>
                <configuration>
                    <programs>
                        <program>
                            <mainclass>org.mbari.clojuretest.App</mainclass>
                            <name>App</name>
                        </program>
                    </programs>
                </configuration>
            </plugin>
            <!--  Integrate Clojure command line tools -->
            <plugin>
                <groupId>com.theoryinpractise</groupId>
                <artifactId>clojure-maven-plugin</artifactId>
                <version>1.3.1</version>
                <configuration>
                    <clojureOptions>-Xmx512m</clojureOptions>
                    <warnOnReflection>true</warnOnReflection>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.7</version>
            <scope>test</scope>
        </dependency>


        <dependency>
            <groupId>incanter</groupId>
            <artifactId>incanter</artifactId>
            <version>1.0-master-SNAPSHOT</version>
        </dependency>

    </dependencies>

    <repositories>
        <repository>
            <id>clojars.org</id>
            <url>http://clojars.org/repo</url>
        </repository>
    </repositories>
</project>

hohonuuli

Developer

Cras justo odio, dapibus ac facilisis in, egestas eget quam. Curabitur blandit tempus porttitor. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor.

0 comments: