Changeset 14168


Ignore:
Timestamp:
10/08/12 18:06:53 (9 years ago)
Author:
Mark Evenson
Message:

Fix ENSURE-REMOTE-REPOSITORY method declaration.

Use the MavenServiceLocator? as opposed to DefaultServiceLocator? which
seems to help out quite a bit.

Add :FORCE keyword options to assist debugging problems.

File:
1 edited

Legend:

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

    r14166 r14168  
    66# Implementation
    77
    8 Not multi-threaded safe, and unclear how much work that would be.
     8Not necessarily multi-threaded safe, and unclear how much work that
     9would be, as it is unknown how the Maven implementation behaves.
    910
    1011## Installing Maven
     
    2324|#
    2425
    25 ;;; N.b. evaluated *after* we load the ABCL specific modifications of ASDF in abcl-asdf.lisp
     26;;; N.b. evaluated *after* we load the ABCL specific modifications of
     27;;;      ASDF in abcl-asdf.lisp
    2628
    2729(in-package :abcl-asdf)
     
    158160  "A list of possible candidate implementations that provide access to http and https resources.
    159161
    160 Supposedly configurable with the java.net.protocols (c.f. reference maso2000 in the Manual.")
     162Supposedly configurable with the java.net.protocols (c.f. reference maso2000 in the Manual.)")
    161163
    162164(defun make-wagon-provider ()
     
    185187  (unless *init* (init))
    186188  (let ((locator
    187          (java:jnew "org.apache.maven.repository.internal.DefaultServiceLocator"))
     189         (java:jnew "org.apache.maven.repository.internal.MavenServiceLocator"))
     190        (wagon-provider-class
     191         (java:jclass "org.sonatype.aether.connector.wagon.WagonProvider"))
     192        (wagon-repository-connector-factory-class
     193         (java:jclass "org.sonatype.aether.connector.wagon.WagonRepositoryConnectorFactory"))
    188194        (repository-connector-factory-class
    189195         (java:jclass "org.sonatype.aether.spi.connector.RepositoryConnectorFactory"))
    190         (wagon-repository-connector-factory-class
    191          (java:jclass "org.sonatype.aether.connector.wagon.WagonRepositoryConnectorFactory"))
    192         (wagon-provider-class
    193          (java:jclass "org.sonatype.aether.connector.wagon.WagonProvider"))
    194196        (repository-system-class
    195197         (java:jclass "org.sonatype.aether.RepositorySystem")))
    196     (#"addService" locator
    197                    repository-connector-factory-class
    198                    wagon-repository-connector-factory-class)
    199198    (#"setServices" locator
    200199                    wagon-provider-class
    201                     (java:jnew-array-from-list
    202                      "org.sonatype.aether.connector.wagon.WagonProvider"
    203                      (list
    204                       (make-wagon-provider))))
    205     (#"getService" locator
    206                    repository-system-class)))
     200                   (java:jarray-from-list
     201                    (list (make-wagon-provider))))
     202    (#"addService" locator
     203                   repository-connector-factory-class
     204                   wagon-repository-connector-factory-class)
     205    (values (#"getService" locator
     206                           repository-system-class)
     207            locator)))
    207208       
    208209(defun make-session (repository-system)
     
    216217    (#"setLocalRepositoryManager"
    217218     session
    218      (#"newLocalRepositoryManager" repository-system local-repository))))
     219     (#"newLocalRepositoryManager" repository-system
     220                                   local-repository))))
    219221
    220222(defparameter *maven-http-proxy* nil
     
    241243(defparameter *repository-system*  nil
    242244  "The org.sonatype.aether.RepositorySystem used by the Maeven Aether connector.")
    243 (defun ensure-repository-system ()
    244   (unless *repository-system*
     245(defun ensure-repository-system (&key (force nil))
     246  (when (or force (not *repository-system*))
    245247    (setf *repository-system* (make-repository-system)))
    246248  *repository-system*)
     
    248250(defparameter *session* nil
    249251  "Reference to the Maven RepositorySystemSession")
    250 (defun ensure-session ()
     252(defun ensure-session (&key (force nil))
    251253  "Ensure that the RepositorySystemSession has been created.
    252254
    253255If *MAVEN-HTTP-PROXY* is non-nil, parse its value as the http proxy."
    254   (unless *session*
    255     (ensure-repository-system)
     256  (when (or force (not *session*))
     257    (ensure-repository-system :force force)
    256258    (setf *session* (make-session *repository-system*))
    257259    (#"setRepositoryListener" *session* (make-repository-listener))
     
    298300(defparameter *maven-remote-repository*  nil
    299301    "The remote repository used by the Maven Aether embedder.")
    300 (defun ensure-remote-repository (&key repository *default-repository* repository-p)
     302(defun ensure-remote-repository (&key
     303                                   (force nil)
     304                                   (repository *default-repository* repository-p))
    301305  (unless *init* (init))
    302   (unless (or repository-p
    303               *maven-remote-repository*)
     306  (when (or force 
     307            repository-p
     308            (not *maven-remote-repository*))
    304309    (let ((r (make-remote-repository "central" "default" repository)))
    305310      (when *maven-http-proxy*
Note: See TracChangeset for help on using the changeset viewer.