Move the failing test for maven dependencies into ABCL-ASDF

This test only makes sends if ABCL-ASDF can be loaded.

Fixed 't/resolve-multiple-maven-dependencies.lisp' to running, but now
failing on download of HeRMIT artifact:

     Java exception
     'org.eclipse.aether.resolution.DependencyResolutionException: The
     following artifacts could not be resolved:
     net.sourceforge.owlapi:org.semanticweb.hermit:jar:1.3.8.413,
     net.sourceforge.owlapi:owlapi-distribution:jar:4.2.6,
     net.sourceforge.owlapi:pellet-cli-ignazio1977:jar:2.4.0-ignazio1977,
     org.semanticweb.elk:elk-reasoner:jar:0.4.3,
     net.sourceforge.owlapi:owlexplanation:jar:2.0.0: Could not find
     artifact net.sourceforge.owlapi:org.semanticweb.hermit:jar:1.3.8.413'.
parent d89c4eac
......@@ -15,6 +15,7 @@
:depends-on (package)
:components ((:test-file "log4j")
(:test-file "resolve")
(:test-file "resolve-multiple-maven-dependencies")
(:test-file "maven"))))
:perform (asdf:test-op (op c)
(uiop:symbol-call :prove-asdf 'run-test-system c)))
......
(in-package :cl-user)
(require :jss)
;; https://maven.apache.org/guides/introduction/introduction-to-optional-and-excludes-dependencies.html
;; if a artifact is root then its optional dependencies are
;; collected. If the same artifact is not root, then the optional
......@@ -23,16 +26,16 @@
dependencies, set this to t. Usually not.
"
(let ((collect-request (java:jnew (jss:find-java-class "CollectRequest")))
(exclusions-collection (new 'hashset) )
(exclusions-collection (jss:new 'hashset) )
(compile-scope #"JavaScopes.COMPILE"))
(loop for e in exclusions
for (groupid artifactid) = (split-at-char e #\:)
for (groupid artifactid) = (abcl/build:split-string e #\:)
;; If i have scope be compile-scope it doesn't get excluded!!
for exclusion = (new 'aether.graph.Exclusion groupid artifactid "" "jar")
for exclusion = (jss:new 'aether.graph.Exclusion groupid artifactid "" "jar")
do (#"add" exclusions-collection exclusion))
(loop for a in dependencies
for artifact = (abcl-asdf::make-artifact (#"replaceAll" a "/" ":"))
for dependency = (new 'aether.graph.Dependency artifact compile-scope)
for dependency = (jss:new 'aether.graph.Dependency artifact compile-scope)
do
;; setExclusions returns a new dependency. We have to use that. That passed dependency is not modified!
;; http://grepcode.com/file/repo1.maven.org/maven2/org.eclipse.aether/aether-api/1.0.2.v20150114/org/eclipse/aether/graph/Dependency.java#Dependency.getOptional%28%29
......@@ -44,32 +47,34 @@
(setq first-is-root nil))
(loop for a in managed-dependencies
for artifact = (abcl-asdf::make-artifact (#"replaceAll" a "/" ":"))
for dependency = (new 'aether.graph.Dependency artifact compile-scope)
for dependency = (jss:new 'aether.graph.Dependency artifact compile-scope)
do (setq dependency (#"setExclusions" dependency exclusions-collection))
(#"addManagedDependency" collect-request dependency))
(let ((dependencies (#"collectDependencies"
(abcl-asdf::ensure-repository-system)
(abcl-asdf::ensure-session) collect-request))
(nodelist-generator (new 'PreorderNodeListGenerator))
(dependency-request (new 'DependencyRequest)))
(#"setRoot" dependency-request (#"getRoot" dependencies))
(#"resolveDependencies" (abcl-asdf::ensure-repository-system) (abcl-asdf::ensure-session) dependency-request)
(#"accept" (#"getRoot" dependencies) nodelist-generator)
(split-at-char (#"getClassPath" nodelist-generator) #\:)
)))
(nodelist-generator (jss:new 'PreorderNodeListGenerator))
(dependency-request (jss:new 'DependencyRequest)))
(#"setRoot" dependency-request
(#"getRoot" dependencies))
(#"resolveDependencies" (abcl-asdf::ensure-repository-system)
(abcl-asdf::ensure-session)
dependency-request)
(#"accept" (#"getRoot" dependencies)
nodelist-generator)
(abcl/build:split-string (#"getClassPath" nodelist-generator) #\:))))
(prove:plan 3)
(let ((deps (resolve-multiple-maven-dependencies '("net.sourceforge.owlapi:org.semanticweb.hermit:1.3.8.413"
"net.sourceforge.owlapi:owlapi-distribution:4.2.6"
"net.sourceforge.owlapi/pellet-cli-ignazio1977/2.4.0-ignazio1977"
"org.semanticweb.elk/elk-reasoner/0.4.3"
"net.sourceforge.owlapi/owlexplanation/2.0.0")
'("net.sourceforge.owlapi:owlapi-distribution:4.2.6")
'("net.sourceforge.owlapi:owlapi-osgidistribution"
"edu.stanford.protege:org.protege.editor.owl")
)))
(let ((deps (resolve-multiple-maven-dependencies
'("net.sourceforge.owlapi:org.semanticweb.hermit:1.3.8.413"
"net.sourceforge.owlapi:owlapi-distribution:4.2.6"
"net.sourceforge.owlapi/pellet-cli-ignazio1977/2.4.0-ignazio1977"
"org.semanticweb.elk/elk-reasoner/0.4.3"
"net.sourceforge.owlapi/owlexplanation/2.0.0")
'("net.sourceforge.owlapi:owlapi-distribution:4.2.6")
'("net.sourceforge.owlapi:owlapi-osgidistribution"
"edu.stanford.protege:org.protege.editor.owl"))))
(prove:ok (= (length deps) 87))
(prove:ok (not (find "owlapi-osgidistribution" deps :test 'search)))
(prove:ok (not (find "protege" deps :test 'search))))
......
......@@ -4,7 +4,8 @@
(let ((result (abcl-asdf:resolve-dependencies "org.armedbear.lisp" "abcl")))
(and result
(format *standard-output* "~&~A~%" result)
(type-p result 'cons))))
(type-p result 'cons)))
"Resolving ABCL from distributed Maven POM graph.")
(prove:finalize)
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