Source

clojurewise / mavenlog.clj

(import 'org.apache.commons.logging.LogFactory)
(import 'org.apache.maven.plugin.logging.Log)

; This is needed to avoid "The LogFactory attribute maven.log must be set."
; exception
(defn setup-maven-logging []
  (let [factory (LogFactory/getFactory)
        mvnlog (proxy [Log] []
                 (debug [msg & args])
                 (info [msg & args])
                 (warn [msg & args] (println "<WARN> " msg))
                 (error [msg & args] (println "<ERROR> " msg))
                 (isDebugEnabled [] false)
                 (isInfoEnabled [] false)
                 (isWarnEnabled [] true)
                 (isErrorEnabled [] true))]
  (.setAttribute factory "maven.log" mvnlog)))