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

Last change on this file was 14574, checked in by mevenson, 4 years ago

abcl-asdf/1.3.0: updated to work with maven-3.1.0.

Big thanks to Anton Vodonosov for the initial patch.

The code in maven-embedder.lisp should now work for all versions of
Maven greater than 3.0.3.

Added MAKE-ARTIFACT and MAKE-ARTIFACT-REQUEST for creating the
correponding Aether objects.

File size: 6.0 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 specific contributions to ASDF system definition mainly concerned
12with finding JVM artifacts such as jar archives to be dynamically loaded.
13
14Example 1
15---------
16
17For the following ASDF definition stored in a file named "log4j.asd"
18that loadable by ASDF
19
20    ;;;; -*- Mode: LISP -*-
21    (in-package :asdf)
22
23    (defsystem log4j
24      :components ((:mvn "log4j/log4j/1.2.13")))
25
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)))))
34      (#"trace" logger "Kilroy wuz here."))
35 
36output the message "Kilroy wuz here" to the log4j logging system.
37     
38
39API
40---
41
42We define an API within the ASDF package consisting of the following
43ASDF classes derived from ASDF:COMPONENT:
44
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).
48
49    The MVN and IRI classes descend from ASDF-COMPONENT, but do not
50    directly have a filesystem location.
51
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.
55
56The MVN component should specify 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
78For use outside of ASDF, we currently define the generic function
79ABCL-ASDF:RESOLVE which locates, downloads, caches, and then loads
80into the currently executing JVM process all recursive dependencies
81annotated in the ditributed Maven pom.xml graph.
82
83One can muffle the verbosity of the Maven Aether resolver by setting
84ABCL-ASDF:*MAVEN-VERBOSE* to NIL.
85
86Example 2
87---------
88
89Bypassing ASDF, one can directly issue requests for the Maven
90artifacts to be downloaded
91
92    CL-USER> (abcl-asdf:resolve "com.google.gwt:gwt-user")
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
99ABCL-ASDF:RESOLVE does not added the resolved dependencies to the
100current JVM classpath.  Use JAVA:ADD-TO-CLASSPATH as follows to do
101that:
102
103    CL-USER> (java:add-to-classpath (abcl-asdf:as-classpath (abcl-asdf:resolve "com.google.gwt:gwt-user")))
104
105Example 3
106---------
107
108For a filesystem of jar archives:
109
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
135
136The following ASDF defintion loads enough JVM artifacts to use the
137[IRIS reasoner][1]:
138
139    (defsystem :wsml2reasoner-jars
140      :version "0.6.4"  ;; last sync with SVN
141      :defsystem-depends-on (abcl-contrib abcl-asdf) :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")))
156      (:module log4j-libs
157         :pathname "lib/ext/log4j/" :components
158       ((:jar-file "log4j-1.2.14")))))
159
160[1]:  http://www.iris-reasoner.org/
161
162#### Colophon
163
164    Mark <evenson.not.org@gmail.com>
165   
166    Created: 2011-01-01
167    Revised: 2013-08-16
168   
Note: See TracBrowser for help on using the repository browser.