source: trunk/abcl/contrib/abcl-asdf/README.markdown

Last change on this file was 15657, checked in by Mark Evenson, 14 months ago

abcl-asdf: provide restart for installing Maven

Not as useful as one might think, as ASDF apparently swallows all
conditions.

File size: 6.4 KB
Line 
1ABCL-ASDF
2=========
3
4To use:
5
6    CL-USER> (require :abcl-contrib)
7
8    CL-USER> (require :abcl-asdf)
9   
10   
11ABCL-ASDF contains ABCL specific contributions to ASDF system
12definition mainly concerned with finding JVM artifacts such as jar
13archives.  ABCL-ASDF uses the Aether libraries of the Maven build tool
14to locate and download artifacts from its distributed POM graph.  If
15Maven is not installed on your local system, the function
16ABCL-ASDF:INSTALL-LOCAL-MAVEN can be used to install a version under
17the local XDG hierarchy.
18
19Example 1
20---------
21
22For the following ASDF definition stored in a file named "log4j.asd"
23that can be loaded:
24
25    ;;;; -*- Mode: LISP -*-
26    (in-package :asdf)
27
28    (defsystem log4j
29      :components ((:mvn "log4j/log4j/1.2.13")))
30
31After issuing
32
33    CL-USER> (asdf:make :log4j)
34   
35all the Log4j libraries would be dynamically added to the classpath so
36that the following code would
37
38    (let ((logger (#"getLogger" 'log4j.Logger (symbol-name (gensym)))))
39      (#"trace" logger "Kilroy wuz here."))
40 
41output the message "Kilroy wuz here" to the Log4j logging system.
42     
43
44API
45---
46
47We define an API within the ASDF package consisting of the following
48ASDF classes derived from ASDF:COMPONENT:
49
50    JAR-DIRECTORY, JAR-FILE, and CLASS-FILE-DIRECTORY for JVM artifacts
51    that have a currently valid pathname representation (i.e. they exist
52    on the local filesystem).
53
54    The MVN and IRI classes descend from ASDF-COMPONENT, but do not
55    directly have a filesystem location.
56
57    The IRI component is currently unused, but serves as a point to base
58    the inheritance of the MVN component while allowing other forms of
59    uri-like resources to be encapsulated in the future.
60
61The MVN component should specify a [Maven URI][mvn-uri] as its PATH.
62A Maven URI has a namestring of the form
63"GROUP-ID/ARTIFACT-ID/VERSION" which specifies the dependency to be
64satisfied for this component by resolution through the Maven
65distributed dependency graph.  The scheme (the initial "mvn://" in a
66Maven URI) is implied, and usually omitted for brevity.  If a VERSION
67is not specified (i.e. by a namestring like "GROUP-ID/ARTIFACT-ID" for
68the MVN component), then the latest available version of the artifact
69will be retrieved from the network.
70
71[mvn-uri]: http://team.ops4j.org/wiki/display/paxurl/Mvn+Protocol
72
73The MVN component may specify a CLASSNAME which if present in the
74current jvm, inhibits further loading from the network.  This may be
75used to bypass the invocation of Maven.  Since classnames are not
76unique to jar archives, this mechanism may not have the desired result
77in all cases, but it is surpisingly, like the rest of Java, "good
78enough" for everyday use.
79
80The MVN component may specify an ALTERNATE-URI which will be added to
81the jvm classpath if Maven cannot be located.  Since a Maven URI may
82refer to more than one binary artifact, this may not work in all cases.
83
84For use outside of ASDF, we currently define the generic function
85ABCL-ASDF:RESOLVE which locates, downloads, caches, and then loads
86into the currently executing JVM process all recursive dependencies
87annotated in the ditributed Maven pom.xml graph.
88
89One can muffle the verbosity of the Maven Aether resolver by setting
90CL:*load-VERBOSE* to NIL.
91
92Example 2
93---------
94
95Bypassing ASDF, one can directly issue requests for the Maven
96artifacts to be downloaded
97
98    CL-USER> (abcl-asdf:resolve "com.google.gwt:gwt-user")
99    WARNING: Using LATEST for unspecified version.
100    "/Users/evenson/.m2/repository/com/google/gwt/gwt-user/2.4.0-rc1/gwt-user-2.4.0-rc1.jar:/Users/evenson/.m2/repository/javax/validation/validation-api/1.0.0.GA/validation-api-1.0.0.GA.jar:/Users/evenson/.m2/repository/javax/validation/validation-api/1.0.0.GA/validation-api-1.0.0.GA-sources.jar"
101
102Notice that all recursive dependencies have been located and installed
103as well.
104
105ABCL-ASDF:RESOLVE does not added the resolved dependencies to the
106current JVM classpath.  Use JAVA:ADD-TO-CLASSPATH as follows to do
107that:
108
109    CL-USER> (java:add-to-classpath (abcl-asdf:as-classpath (abcl-asdf:resolve "com.google.gwt:gwt-user")))
110
111Example 3
112---------
113
114For a filesystem of jar archives:
115
116    ./lib/ext/flora2-reasoner/XSBFlora.jar
117    ./lib/ext/iris-reasoner/iris/iris-0.58.jar
118    ./lib/ext/iris-reasoner/jgrapht/jgrapht-jdk1.5-0.7.1.jar
119    ./lib/ext/log4j/log4j-1.2.14.jar
120    ./lib/ext/mandrax-reasoner/commons-collections-2.1.jar
121    ./lib/ext/mandrax-reasoner/jdom-b10.jar
122    ./lib/ext/mandrax-reasoner/log4j-1.2.8.jar
123    ./lib/ext/mandrax-reasoner/mandarax-3.4.jar
124    ./lib/ext/mins-reasoner/mins-v0_3.jar
125    ./lib/ext/pellet-reasoner/aterm/1.6/aterm-java-1.6.jar
126    ./lib/ext/pellet-reasoner/commons-logging/1.1/commons-logging-1.1.jar
127    ./lib/ext/pellet-reasoner/kaon/1.2.9/rdfapi.jar
128    ./lib/ext/pellet-reasoner/owl-api/1.4.3/abstractparser.jar
129    ./lib/ext/pellet-reasoner/owl-api/1.4.3/io.jar
130    ./lib/ext/pellet-reasoner/owl-api/1.4.3/rdfparser.jar
131    ./lib/ext/pellet-reasoner/owl-api/1.4.3/validation.jar
132    ./lib/ext/pellet-reasoner/owl-api/owl-api-econn/2006-04-27/api.jar
133    ./lib/ext/pellet-reasoner/owl-api/owl-api-econn/2006-04-27/impl.jar
134    ./lib/ext/pellet-reasoner/pellet/pellet.jar
135    ./lib/ext/pellet-reasoner/relaxng/1.0/relaxngDatatype.jar
136    ./lib/ext/pellet-reasoner/xsdlib/xsdlib.jar
137    ./lib/ext/wsmo/WSML-grammar-20081202.jar
138    ./lib/ext/wsmo/wsmo-api-0.6.2.jar
139    ./lib/ext/wsmo/wsmo4j-0.6.2.jar
140    ./lib/ext/xsb-system/interprolog.jar
141
142The following ASDF defintion loads enough JVM artifacts to use the
143[IRIS reasoner][iris-reasoner]:
144
145    (defsystem :wsml2reasoner-jars
146      :version "0.6.4"  ;; last sync with SVN
147      :defsystem-depends-on (abcl-contrib abcl-asdf) :components
148    ((:module wsml2reasoner
149      :pathname "lib/" :components
150      ((:jar-file "wsml2reasoner")))
151      (:module iris-libs
152        :pathname "lib/ext/iris-reasoner/iris/" :components
153      ((:jar-file "iris-0.58")))
154      (:module jgrapht-libs
155      :pathname "lib/ext/iris-reasoner/jgrapht/" :components
156      ((:jar-file "jgrapht-jdk1.5-0.7.1")))
157      (:module wsmo-libs
158      :pathname "lib/ext/wsmo/" :components
159      ((:jar-file "WSML-grammar-20081202")
160       (:jar-file "wsmo-api-0.6.2")
161       (:jar-file "wsmo4j-0.6.2")))
162      (:module log4j-libs
163         :pathname "lib/ext/log4j/" :components
164       ((:jar-file "log4j-1.2.14")))))
165
166[iris-reasoner]:  http://www.iris-reasoner.org/
167
168#### Colophon
169
170    Mark <evenson.not.org@gmail.com>
171   
172    Created: 2011-01-01
173    Revised: 2023-02-23
174   
175   
Note: See TracBrowser for help on using the repository browser.