Skip to content

Instantly share code, notes, and snippets.

Feb 03, 2014 1:31:19 PM org.sonatype.guice.bean.reflect.Logs$JULSink warn
WARNING: Error injecting: org.apache.maven.model.io.DefaultModelReader
java.lang.NoClassDefFoundError: org/apache/maven/model/InputSource
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2531)
at java.lang.Class.getDeclaredMethods(Class.java:1855)
at com.google.inject.spi.InjectionPoint.getInjectionPoints(InjectionPoint.java:664)
at com.google.inject.spi.InjectionPoint.forInstanceMethodsAndFields(InjectionPoint.java:358)
at com.google.inject.internal.ConstructorBindingImpl.getInternalDependencies(ConstructorBindingImpl.java:155)
at com.google.inject.internal.InjectorImpl.getInternalDependencies(InjectorImpl.java:585)
@m0smith
m0smith / gist:10925790
Last active August 29, 2015 13:59
Dependency Injection in Clojure 1 - global (non-DI)
(def context (init-context))
(def foo []
(let [db (:db context)]
(update! db "foo")))
@m0smith
m0smith / dibinding.clj
Created April 16, 2014 19:59
Dependency Injection in Clojure 2 - Binding
(def ^:dynamic *context* {})
(defn foo []
(let [db (:db *context*)]
(update! db "foo")))
(defn start-app []
(binding [*context* (init-context)]
(foo)))
@m0smith
m0smith / diarg.clj
Last active August 29, 2015 13:59
Depedency Injection in Clojure 3 - Function Argument
(defn foo [context]
(let [db (:db context)]
(update! db "foo")))
(defn start-app [context]
(foo context))
(start-app (init-context))
@m0smith
m0smith / diclosure.clj
Last active August 29, 2015 13:59
Dependency Injection in Clojure 4 - Closure
(defn wrap-context [context]
(let [db (:db context})]
(letfn [
(foo [] (update! db "foo"))
(app [] (foo))]
app)))
@m0smith
m0smith / direader.clj
Created April 17, 2014 01:13
Dependency Injection in Clojure 5.1 - Reader Monad
(defn foo []
(domonad reader-m [db (asks :db)]
(update! db "foo")))
(defn app []
(domonad reader-m [_ (foo)]))
((app) (init-context))
@m0smith
m0smith / direader2.clj
Created April 17, 2014 01:29
Transform reader monad
(defn foo* [context]
(let [db (get context :db)]
(update! db "foo")))
(defn app* [context]
(let [_ (foo* context)]))
(defnctx-keys foo [db]
(update! db "foo")))
(defnctx app [_ (foo)])
(apply-ctx app (init-context))
@m0smith
m0smith / malabar-flycheck.el
Created December 10, 2014 15:13
Trying to get a flycheck checker that will be a callback from url-retrieve
(require 'flycheck)
(defun malabar-flycheck-command ( checker cback )
"Use flycheck to search the current buffer for compiler errrors."
(if (not (comint-check-proc "*groovy*"))
(funcall cback 'finished nil)
(let* ((pom (ede-find-project-root "pom.xml"))
(pom-path (format "%spom.xml" pom))
(script (if (buffer-modified-p) (buffer-file-name) (buffer-file-name))))
@m0smith
m0smith / tooling.out
Created March 19, 2015 17:42
Sample groovysh using Gradle Tooling
Groovy Shell (2.3.7, JVM: 1.7.0_45)
Type ':help' or ':h' for help.
groovy:000>
malabar = { classLoader = new groovy.lang.GroovyClassLoader();
Map[] grapez = [[group: 'com.software-ninja' , module:'malabar', version:'2.3.2-SNAPSHOT']];
groovy.grape.Grape.grab(classLoader: classLoader, grapez);
classLoader.loadClass('com.software_ninja.malabar.MalabarStart').newInstance().startCL(classLoader); };
malabar();
groovy:000> malabar = { classLoader = new groovy.lang.GroovyClassLoader();