Skip to content

Instantly share code, notes, and snippets.

@stuartgunter
Created September 15, 2012 08:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stuartgunter/3727047 to your computer and use it in GitHub Desktop.
Save stuartgunter/3727047 to your computer and use it in GitHub Desktop.
Execute Clojure script in Maven
(ns cljmvn)
(println (str "Hello " (first *command-line-args*)))
<plugin>
<groupId>com.theoryinpractise</groupId>
<artifactId>clojure-maven-plugin</artifactId>
<version>1.3.11</version>
<executions>
<execution>
<id>exec-clojure-script</id>
<phase>validate</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<script>src/build/scripts/cljmvn.clj</script>
<args>Stuart</args>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<executions>
<execution>
<id>exec-clojure-script</id>
<phase>validate</phase>
<goals>
<goal>java</goal>
</goals>
<configuration>
<arguments>
<!-- the script to import -->
<argument>src/build/scripts/cljmvn.clj</argument>
<!-- script args -->
<argument>Stuart</argument>
</arguments>
<mainClass>clojure.main</mainClass>
<includePluginDependencies>true</includePluginDependencies>
</configuration>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.clojure</groupId>
<artifactId>clojure</artifactId>
<version>${clojure.version}</version>
</dependency>
</dependencies>
</plugin>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment