I did it with "protege-nrepl".

Protege is a tool build on eclipse, which is build on OSGi.
protege-nrepl embed clojure inside Protege, and enables it to put up an
NREPL server.

I found it to be a bit of a nightmare to be honest. The key problem was
was that for protege-nrepl to be useful, I need to able to expand the
running Clojure dynamically. Otherwise, I have to bundle all of the
clojure that I want to use with protege.

Theoretically, this should be easy with pomegranate, but in practice
this fails because OSGi requires the package to state before what
classes a package is going to use when the OSGi package is built. But I
don't know what those are!

The eventually solution was to add this 

<DynamicImport-Package>*</DynamicImport-Package>

to my maven config.

https://github.com/phillord/protege-nrepl/blob/master/nrepl-plugin/pom.xml

This solves the problem, but AFAICT defeats the point of OSGi since now
there is no isolation.

Phil

Colin Yates <colin.ya...@gmail.com> writes:

> Do you have any references to OSGi and Clojure?
>
> On 2 April 2015 at 15:11, Alex Miller <a...@puredanger.com> wrote:
>> It's possible we could make use of Java's module system if it ever actually
>> gets released in Java 9. While I followed it pretty extensively when they
>> first started discussing it (7 or 8 years ago!) I have not been keeping up
>> on it lately. Some people have used OSGi with Clojure but I don't gather
>> that it's a picnic. Designing a good module system, especially one that
>> takes into account Java's classloader architecture, is a challenging task.
>>
>> Personally, I think it's probably useful to think about your namespace
>> layout, so I'm not really looking to get rid of the thinking part. :)
>>
>>
>> On Thursday, April 2, 2015 at 6:05:25 AM UTC-5, Lars Andersen wrote:
>>>
>>> I'd love a module system solving the following problems:
>>>
>>> 1. Dependency isolation
>>> 2. Being able to export vars without having to think about namespace
>>> layout in the project
>>>
>>> 1. Is a serious problem where transitive dependencies on the classpath put
>>> consumers in "jar hell" and force library and tooling authors to either
>>> inline code, re-invent the wheel, attempt to run their code in isolated
>>> classloaders or turn to source rewriting.
>>>
>>> 2. Is a nice to have which is solved today by in potemkin's import-vars,
>>> but I think this makes sense to include if modules are added to the
>>> language.
>>>
>>> We might get some of this for free whenever project jigsaw gets released,
>>> but considering it was due in 2007, originally, I'm hoping this can be
>>> solved without the help of Oracle.
>>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups "Clojure" group.
>> To post to this group, send email to clojure@googlegroups.com
>> Note that posts from new members are moderated - please be patient with your
>> first post.
>> To unsubscribe from this group, send email to
>> clojure+unsubscr...@googlegroups.com
>> For more options, visit this group at
>> http://groups.google.com/group/clojure?hl=en
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "Clojure" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to clojure+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.

-- 
Phillip Lord,                           Phone: +44 (0) 191 208 7827
Lecturer in Bioinformatics,             Email: phillip.l...@newcastle.ac.uk
School of Computing Science,            
http://homepages.cs.ncl.ac.uk/phillip.lord
Room 914 Claremont Tower,               skype: russet_apples
Newcastle University,                   twitter: phillord
NE1 7RU                                 

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to