Commit d23ec67d authored by mevenson@1c010e3e-69d0-11dd-93a8-456734b0d56f's avatar mevenson@1c010e3e-69d0-11dd-93a8-456734b0d56f
Browse files

abcl-asdf: fix RESOLVE to work with "group-id:artifact-id" parameters.

MVN-VERSION now tries harder to include diagnostic information when it
signals an error.

Fixes <>.
parent df8b9d9b
......@@ -123,25 +123,38 @@ Emits warnings if not able to find a suitable executable."
"Location of 'maven-core-3.<m>.<p>.jar', 'maven-embedder-3.<m>.<p>.jar' etc.")
(defun mvn-version ()
"Return the Maven version used by the Aether connector."
(let ((stream (sys::process-output
(sys::run-program (truename (find-mvn)) '("-version"))))
(pattern (#"compile"
"Apache Maven ([0-9]+)\\.([0-9]+)\\.([0-9]+)")))
(do ((line (read-line stream nil :eof)
(read-line stream nil :eof)))
((or (not line) (eq line :eof)) nil)
(let ((matcher (#"matcher" pattern line)))
(when (#"find" matcher)
(return-from mvn-version
"Return the Maven version used by the Aether connector located by
FIND-MVN as a list of (MAJOR MINOR PATHLEVEL) integers.
Signals a simple-error with additional information if this attempt fails."
(let* ((process (sys:run-program (truename (find-mvn)) '("-version")))
(output (sys:process-output process))
(pattern (#"compile"
"Apache Maven ([0-9]+)\\.([0-9]+)\\.([0-9]+)"))
(do ((line (read-line output nil :eof)
(read-line output nil :eof)))
((or (not line) (eq line :eof)) nil)
(push line lines)
(let ((matcher (#"matcher" pattern line)))
(when (#"find" matcher)
(return-from mvn-version
(mapcar #'parse-integer
`(,(#"group" matcher 1)
,(#"group" matcher 2)
,(#"group" matcher 3)))
(t (e)
(error "Failed to parse Maven version from ~A because~&~A." line e)))))))))
,(#"group" matcher 3)))))))
(when lines
(signal "No parseable Maven version found in ~{~& ~A~}" (nreverse lines)))
(let ((error (sys:process-error process)))
(do ((line (read-line error nil :eof)
(read-line error nil :eof)))
((or (not line) (eq line :eof)) nil)
(push line lines)
(signal "Invocation of Maven returned the error ~{~& ~A~}" (nreverse lines)))))
(t (e)
(error "Failed to determine Maven version: ~A." e))))
(defun ensure-mvn-version ()
"Return t if Maven version is 3.0.3 or greater."
......@@ -504,6 +517,9 @@ artifact and all of its transitive dependencies."
((= (length result) 3)
(first result) (second result) (third result)))
((= (length result) 2)
(first result) (second result)))
((string= string "com.sun.jna:jna")
(warn "Replacing request for no longer available com.sun.jna:jna with")
(resolve-dependencies "" "jna" "LATEST"))
......@@ -104,8 +104,8 @@ The &key arguments have the following meanings:
(let ((process (make-process (%process-builder-start process-builder))))
(when wait (process-wait process))
;;The process structure.
;;; The process structure.
(defstruct (process (:constructor %make-process (jprocess)))
jprocess input output error)
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