source: branches/1.1.x/contrib/abcl-asdf/README.markdown @ 14301

Last change on this file since 14301 was 14301, checked in by Mark Evenson, 8 years ago

doc: Start annotating all the places we need to change things with RDF.
Do

TODO: grovel through the source tree to find all textual lines
containing probable RDF statements.

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