Error formatting macro: pagetree: java.lang.NullPointerException

Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Added "Problems to solve" and "potential solutions"

Problems to Solve

  1. Publishing: Make Clojure and its libraries available to build tools
  2. Building: Compile, test, and package Clojure projects for release
  3. Mixing: Combine Clojure and other languages in one build
  4. Fetching: Download & use external dependencies in Clojure projects

These are all independent! But we expect a build system to do all of them.

Potential Solutions

Maven 2/3 with com.theoryinpractise:clojure-maven-plugin

  • Publishing: Good
    • Already exists
    • Hudson integration
    • Easy deployment to Sonatype OSS
    • Not a Clojure contrib project
  • Building: Fair
    • Inheritance reduces repitition across projects
    • Initial configuration is messy
    • Bad design forces unnecessary compilation steps
    • Slow
    • Not extensible in Clojure
  • Mixing: Good
  • Fetching: Good

Maven 2/3 with redesigned clojure-maven-plugin

  • Publishing: Good
  • Building: Good
    • Opportunity to improve the plugin design
  • Mixing: Good
  • Fetching: Good

Ant with maven-ant-tasks

  • Publishing: Fair
    • Hard to configure deployments
  • Building: Fair
    • No inheritance or reuse
  • Fetching: Poor
  • Mixing: Fair

Clojure-specific tool wrapping Maven (e.g., Leiningen)

  • Publishing: Poor
    • No automatic Sonatype OSS deployment
    • Not a Clojure contrib project
  • Building: Fair
    • Configuration syntax in Clojure
    • Easy to get started
    • Extensible by writing Clojure functions
    • Reinvents the wheel of common Maven plugins
    • No inheritance or reuse
  • Fetching: Good
  • Mixing: Poor
    • Clojure-specific, doesn't support mixed-language projects well

Clojure-specific tool that can use Maven repositories

  • Publishing: Good
  • Building: Fair
    • Configuration syntax in Clojure
    • Opportunity to get the design right
    • Could use Aether for dependency resolution
  • Fetching: Good
  • Mixing: Poor
    • Won't support other languages
    • Reinventing the wheel

Polyglot Maven

  • Publishing: Good
  • Building: Good
    • Configuration syntax in Clojure
    • Not released yet
    • Not a Clojure contrib project
    • Still needs a Maven plugin to build Clojure projects
  • Fetching: Good
  • Mixing: Good

Alternate-language tool (e.g., Gradle)

  • Publishing: Fair?
  • Building: Fair
    • New & unfamiliar syntax
    • Likely needs plugins to build Clojure projects
  • Fetching: Good
  • Mixing: Fair?

Issues to Consider

  • Compatibility with Maven 2.0.x, 2.1.x, and 3.x
  • Compatibility with other popular Maven plugins
    • Javadoc
    • Jar
    • Sources
    • See Clojure's pom.xml for examples
  • Proper integration with Maven Surefire testing plugin?
  • Clojure autodoc support?
  • Fork a new Java process (like Mark Derricutt's plugin) or run in a Classloader?
    • Configurable?
    • Maven Toolchain API support?
    • JVM command-line argument support?
  • What language to write in?
    • Clojure
      • Clojure startup time slows down builds?
      • Makes the plugin depend on the language
      • Have to create plugin metadata XML by hand
      • More extensible?
    • Java
      • Automatically generates plugin metadata XML from source
      • Requires calling Clojure through Java
      • Less flexible?
      • Faster?
  • How to support interactive development?
    • Maven wasn't really designed for that
    • But other languages, e.g. Scala, have made it work
  • Sensible defaults
    • AOT-compile .clj sources?
    • Auto-discovery of namespaces for compilation and/or testing?