[armedbear-devel] installing java dependencies with :mvn ASDF component
Anton Vodonosov
avodonosov at yandex.ru
Sat Aug 10 03:03:59 UTC 2013
The diff from the previous message had several problems.
After fixing the problems one by one I now have working version -
see svn.diff attached (can't submit it as a ticket, because don't know
how to login into the new ABCL Trac).
I must say I now feel how convenient :mvn ASDEF componets are.
I just do (ql:quickload :my-system) and it automatically installs
and loads all the Lisp and Java dependencies (ApachePOI takes 8 .jar files to install).
As for keeping compatibility with old maven. Various approaches possible here.
I would suggest to commit my patch and be compatible with the latest maven
version. If necessary, record a separate ticket to generalize/conditionalize
the :mvn components implementation to make it compatible with both old and new maven.
Best regards,
- Anton
P.S.
Maven 3.1.0 release notes, where they describe Aether API change:
http://maven.apache.org/docs/3.1.0/release-notes.html
10.08.2013, 01:40, "Anton Vodonosov" <avodonosov at yandex.ru>:
> I think I found the reason.
>
> I am using the latest maven 3.1.0. The Aether API has moved to another packages:
> org.eclipse.aether.*
>
> I have changed contrib/abcl-asdf/maven-embedder.lisp file to use new java class names
> (as in the addached svn.diff), and the error seems gone.
>
> I continue to work on the Excel improt, will here report if find new information.
>
> Best regards,
> - Anton
>
> 10.08.2013, 01:01, "Anton Vodonosov" <avodonosov at yandex.ru>:
>
>> Hello.
>>
>> I need to import data from Excel, and following Hans Hübner's article
>> for how to do this with ABCL:
>> http://netzhansa.blogspot.com/2013/03/dealing-with-excel-files-from-common.html
>>
>> The Hans' code depends on Apache POI library.
>>
>> I saw that ABCL comes from abcl-asdf contrib, which extends ASDF by adding a :mnv component,
>> so that we can specify :mvn artifact as a dependency of our ASDF system.
>> I would like to use this facility to automatically install the POI .jar files.
>>
>> I created an .asdf file with this content:
>>
>> (defsystem :excel-s
>> :defsystem-depends-on (:abcl-asdf)
>> :version "0.1.0"
>> :encoding :utf-8
>> :components ((:mvn "org.apache.poi/poi-ooxml/3.9")))
>>
>> Then I invoke ABCL:
>> C:\Users\anton\projects\abcl\abcl.bat --batch --eval "(require :abcl-contrib") --eval "(pushnew \"./\" asdf:*central-registry* :test #'equal)" --eval "(ql:quickload :excel-s)"
>>
>> It fails with exception: java.lang.ClassNotFoundException: aether.util.artifact.DefaultArtifact
>> This exception is throw by abcl-asdf::resolve-dependencies function, defined in the
>> contrib/abcl-asdf/maven-embedder.lisp.
>>
>> Maven is installed on my machine, including the /lib/ directory containing the Aether API jars.
>>
>> I performed some investigation and tried to ensure the Aether .jars are added to classpath:
>>
>> (abcl-asdf::init)
>> (let ((*default-pathname-defaults* abcl-asdf::*mvn-libs-directory*))
>> (dolist (jar-pathname (or (directory "**/*.jar")
>> (error "no jars found in ~S - expected Apache Maven /libs/ directory ~
>> installation there"
>> (merge-pathnames abcl-asdf::*mvn-libs-directory*))))
>> (java:add-to-classpath (namestring jar-pathname))))
>>
>> Still I have the same error - class aether.util.artifact.DefaultArtifact not found.
>>
>> Is the way I am trying to install java libs expected to work, and how to find the problem?
>>
>> Best regards,
>> - Anton
-------------- next part --------------
A non-text attachment was scrubbed...
Name: svn.diff
Type: application/octet-stream
Size: 6749 bytes
Desc: not available
URL: <https://mailman.common-lisp.net/pipermail/armedbear-devel/attachments/20130810/e2e45d85/attachment.obj>
More information about the armedbear-devel
mailing list