ASDF systems using the MVN component now load again.

log4j.asd example corrected as well.

FIND-MVN now emits a warning if it cannot actually find a Maven exectuable.

Thanks to Milos Negovanovic for identifying the problem with a patch.

Fixes #299.
parent 298d4a41
......@@ -131,13 +131,13 @@ single entry denoting a remote binary artifact."
(java:java-exception (e)
(unless (java:jinstance-of-p (java:java-exception-cause e)
"java.lang.ClassNotFoundException")
(error "Unexpected Java exception~&~A.~&" e))
(if (find-mvn)
(resolve-dependencies group-id artifact-id version)
(if alternate-uri
(values (namestring alternate-uri) alternate-uri)
(t
(error "Failed to resolve MVN component name ~A." name)))))))))
(error "Unexpected Java exception~&~A.~&" e))))
(if (find-mvn)
(resolve-dependencies group-id artifact-id version)
(if alternate-uri
(values (namestring alternate-uri) alternate-uri)
(t
(error "Failed to resolve MVN component name ~A." name)))))))
(defun as-classpath (classpath)
"Break apart the JVM CLASSPATH string into a list of its consituents."
......
......@@ -50,7 +50,9 @@ Test:
(defun find-mvn ()
"Attempt to find a suitable Maven ('mvn') executable on the hosting operating system.
Returns the path of the Maven executable or nil if none are found."
Returns the path of the Maven executable or nil if none are found.
Emits warnings if not able to find a suitable executable."
(let ((m2-home (ext:getenv "M2_HOME"))
(m2 (ext:getenv "M2"))
......@@ -97,7 +99,8 @@ Returns the path of the Maven executable or nil if none are found."
"~&Failed to find Maven executable '~A' in PATH because~&~A"
mvn-path e)))))
(when mvn
(return-from find-mvn mvn))))))))
(return-from find-mvn mvn)))))))
(warn "Unable to locate Maven executable."))
(defun find-mvn-libs ()
(let ((mvn (find-mvn)))
......
(in-package :abcl-asdf-test)
(in-package :cl-user)
;;;(deftest LOG4J.2
;;; (progn
(defun test-LOG4J.2 ()
(asdf:load-system "log4j")
(let ((logger (#"getLogger" 'log4j.Logger (symbol-name (gensym)))))
(#"trace" logger "Kilroy wuz here.")))
;;; t)
"Output a message to the Console.
Note: for users of SLIME, this will appear in the associated *inferior-lisp* buffer."
(#"configure" 'log4j.BasicConfigurator)
(#"info" (#"getRootLogger" 'log4j.Logger) "Kilroy wuz here."))
......
;;;; -*- Mode: LISP -*-
(in-package :asdf)
(defsystem :log4j
:components
((:module log4j.jar :components
(asdf:defsystem :log4j
:defsystem-depends-on (abcl-asdf)
:components ((:module log4j.jar :components
((:mvn "log4j/log4j/1.2.15")))
(:module source :pathname "" :components
((:file "example"))
:depends-on (log4j.jar))))
(defmethod perform ((o asdf:test-op) (s (eql (asdf:find-system :log4j))))
(asdf:load-system :log4j)
(eval (read-from-string "(cl-user::test-log4j.2)")))
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment