# HG changeset patch
# Parent 1ce55192468b913fccc847edadcec2b9694a955a
Fix ABCL-ASDF usage with maven-3.3.x
Addresses <http://abcl.org/trac/ticket/390>.
diff -r 1ce55192468b contrib/abcl-asdf/maven-embedder.lisp
a
|
b
|
|
182 | 182 | Set *MVN-LIBS-DIRECTORY* to an explicit value before running this |
183 | 183 | function in order to bypass the dynamic introspection of the location |
184 | 184 | of the mvn executable with an explicit value." |
| 185 | (when force |
| 186 | (setf *session* nil |
| 187 | *repository-system* nil)) |
185 | 188 | (unless (or force *mvn-libs-directory*) |
186 | 189 | (setf *mvn-libs-directory* (find-mvn-libs))) |
187 | 190 | (unless (and *mvn-libs-directory* |
… |
… |
|
250 | 253 | (find-service-locator)) |
251 | 254 | (wagon-provider-class |
252 | 255 | (or |
| 256 | (ignore-errors ;; Maven-3.3.x |
| 257 | (jss:find-java-class 'connector.transport.TransporterFactory)) |
253 | 258 | (ignore-errors ;; Maven-3.2.5 |
254 | 259 | (jss:find-java-class 'org.eclipse.aether.transport.wagon.WagonProvider)) |
255 | 260 | (ignore-errors ;; Maven-3.1.x |
… |
… |
|
280 | 285 | (jss:find-java-class 'aether.RepositorySystem)) |
281 | 286 | (ignore-errors |
282 | 287 | (java:jclass "org.sonatype.aether.RepositorySystem"))))) |
283 | | (#"setServices" locator |
284 | | wagon-provider-class |
285 | | (java:jarray-from-list |
286 | | (list (make-wagon-provider)))) |
| 288 | |
| 289 | (if (equal wagon-provider-class (ignore-errors (jss:find-java-class 'TransporterFactory))) |
| 290 | ;;; Maven-3.3.3 |
| 291 | (let ((wagon-transporter-factory (jss:new 'WagonTransporterFactory))) |
| 292 | (#"setWagonProvider" wagon-transporter-factory (make-wagon-provider)) |
| 293 | (#"setServices" locator |
| 294 | wagon-provider-class |
| 295 | (java:jarray-from-list (list wagon-transporter-factory)))) |
| 296 | (#"setServices" locator |
| 297 | wagon-provider-class |
| 298 | (java:jarray-from-list |
| 299 | (list (make-wagon-provider))))) |
287 | 300 | (#"addService" locator |
288 | 301 | repository-connector-factory-class |
289 | 302 | wagon-repository-connector-factory-class) |
… |
… |
|
364 | 377 | |
365 | 378 | (defun make-artifact (artifact-string) |
366 | 379 | "Return an instance of aether.artifact.DefaultArtifact initialized from ARTIFACT-STRING." |
367 | | (or |
| 380 | (or |
368 | 381 | (ignore-errors |
369 | | (jss:new "org.sonatype.aether.util.artifact.DefaultArtifact" artifact-string)) |
| 382 | (jss:new 'aether.artifact.DefaultArtifact artifact-string)) |
370 | 383 | (ignore-errors |
371 | | (jss:new 'aether.artifact.DefaultArtifact artifact-string)))) |
| 384 | (jss:new "org.sonatype.aether.util.artifact.DefaultArtifact" artifact-string)))) |
372 | 385 | |
373 | 386 | (defun make-artifact-request () |
374 | 387 | "Construct a new aether.resolution.ArtifactRequest." |
… |
… |
|
453 | 466 | (make-artifact coords)) |
454 | 467 | (dependency |
455 | 468 | (java:jnew (jss:find-java-class 'aether.graph.Dependency) |
456 | | artifact (java:jfield (jss:find-java-class "JavaScopes") "RUNTIME"))) |
| 469 | artifact (java:jfield (jss:find-java-class "JavaScopes") "COMPILE"))) |
457 | 470 | (collect-request (java:jnew (jss:find-java-class "CollectRequest")))) |
458 | 471 | (#"setRoot" collect-request dependency) |
459 | | (when repository |
460 | | (#"addRepository" collect-request |
461 | | (if repository-p |
462 | | (ensure-remote-repository :repository repository) |
463 | | (ensure-remote-repository)))) |
| 472 | (#"addRepository" collect-request |
| 473 | (if repository-p |
| 474 | (ensure-remote-repository :repository repository) |
| 475 | (ensure-remote-repository))) |
464 | 476 | (let* ((node |
465 | 477 | (#"getRoot" (#"collectDependencies" (ensure-repository-system) (ensure-session) collect-request))) |
466 | | (dependency-request |
| 478 | (dependency-request |
| 479 | ;;; pre Maven-3.3.x |
| 480 | #+nil |
467 | 481 | (java:jnew (jss:find-java-class "DependencyRequest") |
468 | | node java:+null+)) |
| 482 | node java:+null+) |
| 483 | (jss:new 'DependencyRequest)) |
469 | 484 | (nlg |
470 | 485 | (java:jnew (jss:find-java-class "PreorderNodeListGenerator")))) |
| 486 | (#"setRoot" dependency-request node) |
471 | 487 | (#"resolveDependencies" (ensure-repository-system) (ensure-session) dependency-request) |
472 | 488 | (#"accept" node nlg) |
473 | 489 | (#"getClassPath" nlg)))) |