Ok, so I managed to get this working using JDT (as recommended & with a
little help from some pax/ops4j tools, thanks Achim for the suggestion).

However, I'm left with the notion that there is seems to be an apparent
"understanding" that javax.tools doesn't play nice with OSGi and that the
general recommendation is "use jdt instead of javax.tools in OSGi".

Doesn't this sound like it might be a fairly restrictive limitation
considering the evolution of the Java platform toward more dynamic language
design? I would think that javax.tools might play a pretty large role in
this.

Isn't there something the OSGi community should be doing about this?

a) write a spec to add support for it
b) petition the current spec to allow for injectable bytecode resolution,
thus enabling OSGi to be supported
c) something else...

So, I'm no longer asking from the point of view "How to I solve my
immediate problem?" (Done!)

Now I'm asking more as "I don't think the current recommendation is
actually the right solution. (C|Sh)ouldn't we make it better?"

Something like (I'm not really sure if this is possible or if there is a
deeper limitation in javax.tools):

javax.tools.JavaCompiler javaCompiler =
ToolProvider.getSystemJavaCompiler();
StandardJavaFileManager standardFileManager = javaCompiler
.getStandardFileManager(...);
JavaBundleManager javaBundleManager = bundle.adapt(JavaBundleManager.class);
javaBundleManager.someMergeOperationOrWhatever(standardFileManager);
javax.tools.JavaCompiler.CompilationTask ct = javaCompiler.getTask(..,
javaBundleManager,
..);


Sincerely,
- Ray


On Fri, Sep 14, 2012 at 8:27 AM, Thomas Watson <[email protected]> wrote:

> We also do a similar thing in Equinox for jsp support.
>
> Tom
>
>
>
> [image: Inactive hide details for Felix Meschberger ---09/14/2012 06:37:05
> AM---Hi, Am 13.09.2012 um 17:01 schrieb Raymond Auge:]Felix Meschberger
> ---09/14/2012 06:37:05 AM---Hi, Am 13.09.2012 um 17:01 schrieb Raymond Auge:
>
>
>
>    From:
>
>
> Felix Meschberger <[email protected]>
>
>    To:
>
>
> OSGi Developer Mail List <[email protected]>,
>
>
>    Date:
>
>
> 09/14/2012 06:37 AM
>
>    Subject:
>
>
> Re: [osgi-dev] best way to generate a classpath for
> javax.tools.JavaCompiler
> ------------------------------
>
>
>
> Hi,
>
> Am 13.09.2012 um 17:01 schrieb Raymond Auge:
>
>    No, in fact the root problem is trying to do is use jasper to compile
>    JSPs in OSGi.
>
>
> In the Apache Sling project we embed the Eclipse compiler for compiling
> JSPs since this is much easier to embedd and use in the OSGi context.
> Particularly with respect to the class path: the compiler just asks a
> helper class for classes and doesn't care, where these come from.
>
> Regards
> Felix
>
>
>    However, I seem to have once again missed some facts about how this is
>    setup, so ignore this for now. If I actually find a problem I'll come back
>    to it.
>
>    Thanks and sorry for the noise.
>
>    - Ray
>
>
>    On Thu, Sep 13, 2012 at 10:45 AM, BJ Hargrave 
> <*[email protected]*<[email protected]>>
>    wrote:
>       I don't understand the question? Are you trying to package
>       tools.jar as a bundle?
>
>       --
>
>        *BJ Hargrave*
>          Senior Technical Staff Member, IBM
>          OSGi Fellow and CTO of the *OSGi Alliance* <http://www.osgi.org/>
>          *
>          **[email protected]* <[email protected]>
>
>       office: *+1 386 848 1781* <%2B1%20386%20848%201781>
>       mobile: *+1 386 848 3788* <%2B1%20386%20848%203788>
>
>
>
>
>
>
>       From:        Raymond Auge 
> <*[email protected]*<[email protected]>
>       >
>       To:        OSGi Developer Mail List 
> <*[email protected]*<[email protected]>>,
>
>       Date:        2012/09/13 10:41
>       Subject:        [osgi-dev] best way to generate a classpath for
>          javax.tools.JavaCompiler
>       Sent by:        
> *[email protected]*<[email protected]>
>
>       ------------------------------
>
>
>
>
>       Hey all,
>
>       Is there a definitive way to create a classpath for
>       javax.tools.JavaCompiler in OSGi?
>
>       I've asked the same here:
>       *
>       **
>       
> http://stackoverflow.com/questions/12408624/the-definitive-way-to-generate-a-classpath-for-javax-tools-javacompiler-in-osgi
>       
> *<http://stackoverflow.com/questions/12408624/the-definitive-way-to-generate-a-classpath-for-javax-tools-javacompiler-in-osgi>
>
>
>       i.e. does this exist or need to be specified and then implemented?
>
>       --
>       *Raymond Augé* <http://www.liferay.com/web/raymond.auge/profile> 
> <http://twitter.com/#!/rotty3000> |
>       Senior Software Architect | *Liferay, Inc.*<http://www.liferay.com/>
>         <https://twitter.com/#!/liferay>
>
>       ---
>
>
>       8-9 October 2012 |* Liferay **North America Symposium* | *
>       liferay.com/northamerica2012*<http://www.liferay.com/northamerica2012>
>
>
>       16-17 October 2012 |* Liferay **Europe Symposium* | *
>       liferay.com/europe2012* <http://www.liferay.com/europe2012>
>
>       24-25 October 2012 |* Liferay **Spain Symposium* | *
>       liferay.com/spain2012* <http://www.liferay.com/spain2012>
>
>       _______________________________________________
>       OSGi Developer Mail List*
>       **[email protected]* <[email protected]>*
>       
> **https://mail.osgi.org/mailman/listinfo/osgi-dev*<https://mail.osgi.org/mailman/listinfo/osgi-dev>
>
>
>
>
>
>
>
>
>
>
>       _______________________________________________
>       OSGi Developer Mail List*
>       **[email protected]* <[email protected]>*
>       
> **https://mail.osgi.org/mailman/listinfo/osgi-dev*<https://mail.osgi.org/mailman/listinfo/osgi-dev>
>
>
>
>
>    -- *
>    *
>    *Raymond Augé* <http://www.liferay.com/web/raymond.auge/profile> 
> <http://twitter.com/#!/rotty3000> |
>    Senior Software Architect | *Liferay, Inc.* <http://www.liferay.com/>
>    <https://twitter.com/#!/liferay>
>
>    ---
>
>    8-9 October 2012 |* Liferay **North America Symposium* | *
>    liferay.com/northamerica2012* <http://www.liferay.com/northamerica2012>
>
>    16-17 October 2012 |* Liferay **Europe Symposium* | *
>    liferay.com/europe2012* <http://www.liferay.com/europe2012>
>
>    24-25 October 2012 |* Liferay **Spain Symposium* | *
>    liferay.com/spain2012* <http://www.liferay.com/spain2012>
>
>
>
>
>    _______________________________________________
>    OSGi Developer Mail List*
>    **[email protected]* <[email protected]>
>    https://mail.osgi.org/mailman/listinfo/osgi-dev
>
>
> _______________________________________________
> OSGi Developer Mail List
> [email protected]
> https://mail.osgi.org/mailman/listinfo/osgi-dev
>
>
> _______________________________________________
> OSGi Developer Mail List
> [email protected]
> https://mail.osgi.org/mailman/listinfo/osgi-dev
>



-- 
*Raymond Augé* <http://www.liferay.com/web/raymond.auge/profile>
<http://twitter.com/#!/rotty3000> | Senior Software Architect | *Liferay,
Inc.* <http://www.liferay.com>  <https://twitter.com/#!/liferay>

---

8-9 October 2012 |* Liferay **North America Symposium* |
liferay.com/northamerica2012 <http://www.liferay.com/northamerica2012>

16-17 October 2012 |* Liferay **Europe Symposium* |
liferay.com/europe2012<http://www.liferay.com/europe2012>

24-25 October 2012 |* Liferay **Spain Symposium* |
liferay.com/spain2012<http://www.liferay.com/spain2012>

<<ecblank.gif>>

<<graycol.gif>>

_______________________________________________
OSGi Developer Mail List
[email protected]
https://mail.osgi.org/mailman/listinfo/osgi-dev

Reply via email to