Ignore:
Timestamp:
11/28/12 11:06:03 (8 years ago)
Author:
Mark Evenson
Message:

abcl-asdf: restore the ability to use maven-3.0.3

Warn when interpreting alias for "com.sun.jna:jna".

Closes #268.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/abcl/contrib/abcl-asdf/maven-embedder.lisp

    r14233 r14259  
    145145     (and (>= major 3)
    146146          (>= minor 0)
    147           (>= patch 4)))))
     147          (>= patch 3)))))
    148148
    149149(defparameter *init* nil)
     
    155155  (unless (and *mvn-libs-directory*
    156156               (probe-file *mvn-libs-directory*))
    157    (error "You must download maven-3.0.4 or later from http://maven.apache.org/download.html, then set ABCL-ASDF:*MVN-DIRECTORY* appropiately."))
     157   (error "Please obtain and install maven-3.0.4 locally from http://maven.apache.org/download.html, then set ABCL-ASDF:*MVN-DIRECTORY* appropiately."))
    158158 (unless (ensure-mvn-version)
    159    (error "We need maven-3.0.4 or later."))  (add-directory-jars-to-class-path *mvn-libs-directory* nil)
     159   (error "We need maven-3.0.3 or later."))  (add-directory-jars-to-class-path *mvn-libs-directory* nil)
    160160  (setf *init* t))
    161161
    162 (defparameter *http-wagon-implementations*
    163   ;;; maven-3.0.3 reported as not working with all needed functionality
    164   `("org.apache.maven.wagon.providers.http.HttpWagon" ;; introduced as default with maven-3.0.4
    165     "org.apache.maven.wagon.providers.http.LightweightHttpWagon")
    166   "A list of possible candidate implementations that provide access to http and https resources.
    167 
    168 Supposedly configurable with the java.net.protocols (c.f. reference maso2000 in the Manual.)")
     162(defun find-http-wagon ()
     163  "Find an implementation of the object that provides access to http and https resources.
     164
     165Supposedly configurable with the java.net.protocols (c.f. reference
     166maso2000 in the Manual.)"
     167  (handler-case
     168      ;; maven-3.0.4
     169      (java:jnew "org.apache.maven.wagon.providers.http.HttpWagon")
     170    (error ()
     171      ;; maven-3.0.3 reported as not working with all needed functionality
     172      (java:jnew  "org.apache.maven.wagon.providers.http.LightweightHttpWagon"))))
    169173
    170174(defun make-wagon-provider ()
     
    180184     (cond
    181185       ((find role-hint '("http" "https") :test #'string-equal)
    182         (some (lambda (provider) (java:jnew provider)) *http-wagon-implementations*))
     186        (find-http-wagon))
    183187       (t
    184188        (progn
     
    190194     (declare (ignore wagon)))))
    191195
     196(defun find-service-locator ()
     197  (handler-case
     198      (java:jnew "org.apache.maven.repository.internal.MavenServiceLocator") ;; maven-3.0.4
     199    (error ()
     200      (java:jnew "org.apache.maven.repository.internal.DefaultServiceLocator"))))
     201
    192202(defun make-repository-system ()
    193203  (unless *init* (init))
    194204  (let ((locator
    195          (java:jnew "org.apache.maven.repository.internal.MavenServiceLocator"))
     205         (find-service-locator))
    196206        (wagon-provider-class
    197207         (java:jclass "org.sonatype.aether.connector.wagon.WagonProvider"))
     
    416426    (cond
    417427      ((= (length result) 3)
    418        (resolve-dependencies (first result) (second result) (third result)))
     428       (resolve-dependencies
     429        (first result) (second result) (third result)))
    419430      ((string= string "com.sun.jna:jna")
    420        (resolve-dependencies "net.java.dev.jna" "jna" "3.4.0"))
     431       (warn "Replacing request for no longer available com.sun.jna:jna with net.java.dev.jna:jna")
     432       (resolve-dependencies "net.java.dev.jna" "jna" "LATEST"))
    421433      (t
    422434       (apply #'resolve-dependencies result)))))
    423435 
    424 #+nil
    425 (defmethod resolve ((mvn asdf:mvn))
    426   (with-slots (asdf::group-id asdf::artifact-id asdf::version)
    427       (asdf:ensure-parsed-mvn mvn)
    428     (resolve-dependencies (format nil "~A:~A:~A" asdf::group-id asdf::artifact-id asdf::version))))
    429 
    430436;;; Currently the last file listed in ASDF
    431437(provide 'abcl-asdf)
Note: See TracChangeset for help on using the changeset viewer.