[armedbear-devel] patch for automagical JAR loading

Milos Negovanovic milos.negovanovic at gmail.com
Wed Jan 30 11:45:43 UTC 2013

Hi all,

patch is attached. With it this kind of .asd spec works out of the box
and resolves all JARs and puts them in classpath:

(require :asdf)
(require :abcl-contrib)
(require :abcl-asdf)
(require :jss)

(asdf:defsystem #:test-asdf
  :serial t
  :description ""
  :author ""
  :license "Specify license here"
  ((:module jetty
    :serial t
      ((:mvn "org.eclipse.jetty/jetty-server/8.1.8.v20121106")
	(:mvn "org.freemarker/freemarker/2.3.19")))
  (:module source :pathname ""
    :serial t
      ((:file "package")
      (:file "example"))
    :depends-on (:jetty))))

The bug is someplace in abcl-asdf:resolve ... didnt figure out where, i
just used abcl-asdf:resolve-dependencies ... not sure why you want
resolving code in 2 places anyway :).

Milos Negovanovic
milos.negovanovic at gmail.com
-------------- next part --------------
Index: contrib/abcl-asdf/abcl-asdf.lisp
--- contrib/abcl-asdf/abcl-asdf.lisp	(revision 14363)
+++ contrib/abcl-asdf/abcl-asdf.lisp	(working copy)
@@ -31,10 +31,10 @@
    (ensure-parsed-mvn c)))
 (defmethod perform ((operation load-op) (c mvn))
-  (let ((resolved-path 
-         (abcl-asdf:resolve (ensure-parsed-mvn c))))
-    (when (stringp resolved-path)
-      (java:add-to-classpath (abcl-asdf:as-classpath resolved-path)))))
+  (ensure-parsed-mvn c)
+  (with-slots (group-id artifact-id version) c
+    (loop for x in (abcl-asdf:as-classpath (abcl-asdf:resolve-dependencies group-id artifact-id version))
+          do (java:add-to-classpath x))))
 ;;; A Maven URI has the form "mvn:group-id/artifact-id/version"

More information about the armedbear-devel mailing list