Error formatting macro: pagetree: java.lang.NullPointerException
Skip to end of metadata
Go to start of metadata
You are viewing an old version of this page. View the current version. Compare with Current  |   View Page History

Current clojure-maven-plugin

  • Source at github.com/talios/clojure-maven-plugin
  • Good:
    • Deployed to Maven Central
    • Does not depend on any specific version of Clojure
      • Written in Java
    • Handles different JDK versions with the Maven toolchain API
    • Handles different operating systems fairly well
    • Does many things
      • compile, test, swank, nailgun, gendoc, autodoc, etc.
  • Not so good:
    • Not developed under the Clojure CA
      • May be unable to get permission from all contributors
    • Tries to do too many things?
    • Forks a new Java sub-process on every execution
    • Confusing configuration variables
    • Bad defaults
      • AOT-compile everything

What do we need?

  • Essential tasks for building & releasing Clojure projects with Maven
    • AOT-compile
    • Run tests
    • Add Clojure sources to a JAR
  • Useful features for developers
    • Automatic namespace discovery from .clj sources
    • Run a REPL, possibly with wrappers like readline
    • Run a SWANK server
    • Run a Nailgun server
    • Execute arbitrary Clojure code with the project's dependencies on the classpath
    • Execute Clojure in-process or forked
  • The ideal
    • Generic way to execute Clojure code during a Maven build
    • With declarative configuration syntax for common tasks

Ideas

  • Use maven-exec-plugin
    • Supports running any Java class in-process or forked
    • Manages project classpath / dependencies
    • Using it makes the build more script-like, less declarative
  • Use maven-antrun-plugin
    • Supports anything Ant can do
    • Even more flexible than maven-exec-plugin
    • Even more script-like
  • Create a plugin that calls maven-exec-plugin
    • BUT Maven plugins may not depend on other plugins
  • Rewrite clojure-maven-plugin in Java, duplicating some functionality of maven-exec-plugin
    • Configuration option to run in-process or fork
  • Rewrite clojure-maven-plugin in Clojure
    • Can it still launch a process with a different version of Clojure?

What do other JVM languages do?

  • Scala Maven Plugin
    • add-source goal to add project.build.sourceDirectory/../scala
    • compile and testCompile goals
    • "continuous compilation" goal (infinite loop, compiles on file save)
    • "continuous testing" goal
    • "console" goal starts a REPL
    • "run" goal supports multiple configurations with different main class and arguments
  • JRuby Maven Plugin
    • Still "alpha" as of "Last Published: 07/06/2006"
    • See also JRUBY-434
  • GMaven (Groovy)
    • Includes a Maven archetype for Groovy projects
    • Allows shell-style glob to select files to compile
  • maven-jython-plugin
    • Executes Jython as a sub-process
Labels: