You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@netbeans.apache.org by Christian Bourque <ch...@gmail.com> on 2018/05/01 00:28:22 UTC

NetBeans and OSGi bundle/dependencies

Hey guys,


A month ago, I submitted a PR [1] to the project regarding the upgrade of
the NetBeans JGit library to the latest version to benefit from the latest
Git features.


During the reviewing process, Emilian Bold raised some concerns about my
request regarding the new dependencies required by the latest JGit version
and he recommended that I bring this discussion to a wider audience on the
mailing list.


The main issue here is that JGit now depends on some external OSGi
dependencies that aren't already provided by NetBeans (like JSCH and SL4J
for instance). NetBeans already provides some of them like the JSCH
dependency but since it's not an OSGi bundle it doesn't work (see this
exception for more details [2]). Now I may be wrong, but from what I've
read about the NetBeans OSGi bridge (Netigso / Netbinox), as soon as it
sees a library with a manifest entry containing a bundle reference (like in
JGit's case), it will add the said library to a list that will then be
handled by the Equinox container. So I guess the previous error is to be
expected in such cases.


In the end, I was able to circumvent the problem by switching to OSGi
bundles for these dependencies (both repackaged by Apache) and it works but
I understand that it may not be the most proper and elegant solution.


I guess this raises the following question: what would be the best way to
solve this kind of issue?


Thanks,


Christian

[1]
https://github.com/apache/incubator-netbeans/pull/465

[2]
https://gist.github.com/ocafebabe/c94109fbd60c193719f0ccd65472b9e7

Re: NetBeans and OSGi bundle/dependencies

Posted by Christian Bourque <ch...@gmail.com>.
Ok now I see what you mean (at first, I thought you meant to repackage and
publish to Maven Central and that's why I was worried about the licence)!

I'll try to implement what you're suggesting and get back to you with the
results...

Thanks,

C.


On Thu, May 3, 2018 at 7:50 PM, Emilian Bold <em...@protonmail.ch>
wrote:

> > The other option, as Emilian suggested, would be to repackage the JGit
> > library ourselves (without the OSGi stuff) but I'm unsure about how this
> > would work (licence-wise)!
>
> I don't believe it would be much problem licensing-wise.
>
> I remember NetBeans build already doing some repackaging for some
> dependencies (can't remember which!).
>
> Something as basic as re-zipping the JAR with a changed MANIFEST.MF file
> shouldn't be a problem. There certainly is some hook in the Ant build where
> we can do this post-processing.
>
> --emi
>
> ‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
>
> On 4 May 2018 2:22 AM, Christian Bourque <ch...@gmail.com>
> wrote:
>
> > IMHO, the logical solution would be to use the Eclipse artefacts directly
> >
> > and as is, but unfortunately they aren't pushed to Maven central...
> >
> > I asked the question to the JGit's lead developer and he then asked the
> >
> > mailing list here: [1]. It seems that they are only available in their
> >
> > Orbit P2 repository.
> >
> > Are you aware of a way to fetch an external dependency from such a
> >
> > repository in the NetBeans build harness?
> >
> > The other option, as Emilian suggested, would be to repackage the JGit
> >
> > library ourselves (without the OSGi stuff) but I'm unsure about how this
> >
> > would work (licence-wise)!
> >
> > Christian
> >
> > [1]
> >
> > https://dev.eclipse.org/mhonarc/lists/orbit-dev/msg04948.html
> >
> > On Tue, May 1, 2018 at 5:19 AM, Geertjan Wielenga <
> >
> > geertjan.wielenga@googlemail.com> wrote:
> >
> > > Thanks for this work and investigation you've done.
> > >
> > > What would to you be the ideal way to solve this?
> > >
> > > Thanks,
> > >
> > > Gj
> > >
> > > On Tue, May 1, 2018 at 2:28 AM, Christian Bourque <
> > >
> > > christian.bourque@gmail.com> wrote:
> > >
> > > > Hey guys,
> > > >
> > > > A month ago, I submitted a PR [1] to the project regarding the
> upgrade of
> > > >
> > > > the NetBeans JGit library to the latest version to benefit from the
> > > >
> > > > latest
> > > >
> > > > Git features.
> > > >
> > > > During the reviewing process, Emilian Bold raised some concerns
> about my
> > > >
> > > > request regarding the new dependencies required by the latest JGit
> > > >
> > > > version
> > > >
> > > > and he recommended that I bring this discussion to a wider audience
> on
> > > >
> > > > the
> > > >
> > > > mailing list.
> > > >
> > > > The main issue here is that JGit now depends on some external OSGi
> > > >
> > > > dependencies that aren't already provided by NetBeans (like JSCH and
> SL4J
> > > >
> > > > for instance). NetBeans already provides some of them like the JSCH
> > > >
> > > > dependency but since it's not an OSGi bundle it doesn't work (see
> this
> > > >
> > > > exception for more details [2]). Now I may be wrong, but from what
> I've
> > > >
> > > > read about the NetBeans OSGi bridge (Netigso / Netbinox), as soon as
> it
> > > >
> > > > sees a library with a manifest entry containing a bundle reference
> (like
> > > >
> > > > in
> > > >
> > > > JGit's case), it will add the said library to a list that will then
> be
> > > >
> > > > handled by the Equinox container. So I guess the previous error is
> to be
> > > >
> > > > expected in such cases.
> > > >
> > > > In the end, I was able to circumvent the problem by switching to OSGi
> > > >
> > > > bundles for these dependencies (both repackaged by Apache) and it
> works
> > > >
> > > > but
> > > >
> > > > I understand that it may not be the most proper and elegant solution.
> > > >
> > > > I guess this raises the following question: what would be the best
> way to
> > > >
> > > > solve this kind of issue?
> > > >
> > > > Thanks,
> > > >
> > > > Christian
> > > >
> > > > [1]
> > > >
> > > > https://github.com/apache/incubator-netbeans/pull/465
> > > >
> > > > [2]
> > > >
> > > > https://gist.github.com/ocafebabe/c94109fbd60c193719f0ccd65472b9e7
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@netbeans.incubator.apache.org
> For additional commands, e-mail: dev-help@netbeans.incubator.apache.org
>
> For further information about the NetBeans mailing lists, visit:
> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>
>
>
>

Re: NetBeans and OSGi bundle/dependencies

Posted by Christian Bourque <ch...@gmail.com>.
Hi Antonio,

Yes I found that PR yesterday and it's exactly what I needed!

In fact I've just updated my PR with Emilian suggestion and it seems to
work well!

Thanks,

C.

On Sat, May 5, 2018 at 3:35 AM, Antonio <an...@vieiro.net> wrote:

> Hi,
>
> AFAIR extexecution.process & libs.osgi use the "-javac.init" task to patch
> sources, compile them and package a final jar file to use as an external
> binary.
>
> It seems there's an ongoing PR to post-process downloaded binaries [1]. I
> think this may be a better alternative to the "-javac.init" task for this
> use case.
>
> Cheers,
> Antonio
>
>
> [1]
> https://github.com/apache/incubator-netbeans/pull/491
>
>
>
> On 04/05/18 09:46, Emilian Bold wrote:
>
>> The link does load for me but it doesn't really help you with a hook.
>>
>> I found ./extexecution.process/build.xml which does some dependency
>> patch and recompile.
>>
>> Also ./libs.osgi/build.xml
>>
>> --emi
>>
>> ‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
>>
>> On 4 May 2018 4:12 AM, Christian Bourque <ch...@gmail.com>
>> wrote:
>>
>> There is a comment in the default build template file
>>> (nbbuild/templates/projectized.xml):
>>>
>>> <!-- See: http://wiki.netbeans.org/wiki/view/DevFaqExternalLibrariesUp
>>> dated -->
>>>
>>> It seems very interesting for my use case but the page content appears
>>> to be broken?!
>>>
>>> On Thu, May 3, 2018 at 7:50 PM, Emilian Bold <em...@protonmail.ch>
>>> wrote:
>>>
>>> The other option, as Emilian suggested, would be to repackage the JGit>
>>>>> library ourselves (without the OSGi stuff) but I'm unsure about how this>
>>>>> would work (licence-wise)!I don't believe it would be much problem
>>>>> licensing-wise.
>>>>>
>>>>
>>>> I remember NetBeans build already doing some repackaging for some
>>>> dependencies (can't remember which!).
>>>>
>>>> Something as basic as re-zipping the JAR with a changed MANIFEST.MF
>>>> file shouldn't be a problem. There certainly is some hook in the Ant build
>>>> where we can do this post-processing.
>>>>
>>>> --emi
>>>>
>>>> ‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
>>>>
>>>> On 4 May 2018 2:22 AM, Christian Bourque <ch...@gmail.com>
>>>> wrote:
>>>>
>>>> IMHO, the logical solution would be to use the Eclipse artefacts
>>>>> directly
>>>>>
>>>>
>>>>
>>>>>
>>>> and as is, but unfortunately they aren't pushed to Maven central...
>>>>>
>>>>
>>>>
>>>>>
>>>> I asked the question to the JGit's lead developer and he then asked the
>>>>>
>>>>
>>>>
>>>>>
>>>> mailing list here: [1]. It seems that they are only available in their
>>>>>
>>>>
>>>>
>>>>>
>>>> Orbit P2 repository.
>>>>>
>>>>
>>>>
>>>>>
>>>> Are you aware of a way to fetch an external dependency from such a
>>>>>
>>>>
>>>>
>>>>>
>>>> repository in the NetBeans build harness?
>>>>>
>>>>
>>>>
>>>>>
>>>> The other option, as Emilian suggested, would be to repackage the JGit
>>>>>
>>>>
>>>>
>>>>>
>>>> library ourselves (without the OSGi stuff) but I'm unsure about how this
>>>>>
>>>>
>>>>
>>>>>
>>>> would work (licence-wise)!
>>>>>
>>>>
>>>>
>>>>>
>>>> Christian
>>>>>
>>>>
>>>>
>>>>>
>>>> [1]
>>>>>
>>>>
>>>>
>>>>>
>>>> https://dev.eclipse.org/mhonarc/lists/orbit-dev/msg04948.html
>>>>>
>>>>
>>>>
>>>>>
>>>> On Tue, May 1, 2018 at 5:19 AM, Geertjan Wielenga <
>>>>>
>>>>
>>>>
>>>>>
>>>> geertjan.wielenga@googlemail.com> wrote:
>>>>>
>>>>
>>>>
>>>>>
>>>> Thanks for this work and investigation you've done.
>>>>>>
>>>>>
>>>>
>>>>>>
>>>> What would to you be the ideal way to solve this?
>>>>>>
>>>>>
>>>>
>>>>>>
>>>> Thanks,
>>>>>>
>>>>>
>>>>
>>>>>>
>>>> Gj
>>>>>>
>>>>>
>>>>
>>>>>>
>>>> On Tue, May 1, 2018 at 2:28 AM, Christian Bourque <
>>>>>>
>>>>>
>>>>
>>>>>>
>>>> christian.bourque@gmail.com> wrote:
>>>>>>
>>>>>
>>>>
>>>>>>
>>>> Hey guys,
>>>>>>>
>>>>>>
>>>>
>>>>>>>
>>>> A month ago, I submitted a PR [1] to the project regarding the upgrade
>>>>>>> of
>>>>>>>
>>>>>>
>>>>
>>>>>>>
>>>> the NetBeans JGit library to the latest version to benefit from the
>>>>>>>
>>>>>>
>>>>
>>>>>>>
>>>> latest
>>>>>>>
>>>>>>
>>>>
>>>>>>>
>>>> Git features.
>>>>>>>
>>>>>>
>>>>
>>>>>>>
>>>> During the reviewing process, Emilian Bold raised some concerns about my
>>>>>>>
>>>>>>
>>>>
>>>>>>>
>>>> request regarding the new dependencies required by the latest JGit
>>>>>>>
>>>>>>
>>>>
>>>>>>>
>>>> version
>>>>>>>
>>>>>>
>>>>
>>>>>>>
>>>> and he recommended that I bring this discussion to a wider audience on
>>>>>>>
>>>>>>
>>>>
>>>>>>>
>>>> the
>>>>>>>
>>>>>>
>>>>
>>>>>>>
>>>> mailing list.
>>>>>>>
>>>>>>
>>>>
>>>>>>>
>>>> The main issue here is that JGit now depends on some external OSGi
>>>>>>>
>>>>>>
>>>>
>>>>>>>
>>>> dependencies that aren't already provided by NetBeans (like JSCH and
>>>>>>> SL4J
>>>>>>>
>>>>>>
>>>>
>>>>>>>
>>>> for instance). NetBeans already provides some of them like the JSCH
>>>>>>>
>>>>>>
>>>>
>>>>>>>
>>>> dependency but since it's not an OSGi bundle it doesn't work (see this
>>>>>>>
>>>>>>
>>>>
>>>>>>>
>>>> exception for more details [2]). Now I may be wrong, but from what I've
>>>>>>>
>>>>>>
>>>>
>>>>>>>
>>>> read about the NetBeans OSGi bridge (Netigso / Netbinox), as soon as it
>>>>>>>
>>>>>>
>>>>
>>>>>>>
>>>> sees a library with a manifest entry containing a bundle reference (like
>>>>>>>
>>>>>>
>>>>
>>>>>>>
>>>> in
>>>>>>>
>>>>>>
>>>>
>>>>>>>
>>>> JGit's case), it will add the said library to a list that will then be
>>>>>>>
>>>>>>
>>>>
>>>>>>>
>>>> handled by the Equinox container. So I guess the previous error is to be
>>>>>>>
>>>>>>
>>>>
>>>>>>>
>>>> expected in such cases.
>>>>>>>
>>>>>>
>>>>
>>>>>>>
>>>> In the end, I was able to circumvent the problem by switching to OSGi
>>>>>>>
>>>>>>
>>>>
>>>>>>>
>>>> bundles for these dependencies (both repackaged by Apache) and it works
>>>>>>>
>>>>>>
>>>>
>>>>>>>
>>>> but
>>>>>>>
>>>>>>
>>>>
>>>>>>>
>>>> I understand that it may not be the most proper and elegant solution.
>>>>>>>
>>>>>>
>>>>
>>>>>>>
>>>> I guess this raises the following question: what would be the best way
>>>>>>> to
>>>>>>>
>>>>>>
>>>>
>>>>>>>
>>>> solve this kind of issue?
>>>>>>>
>>>>>>
>>>>
>>>>>>>
>>>> Thanks,
>>>>>>>
>>>>>>
>>>>
>>>>>>>
>>>> Christian
>>>>>>>
>>>>>>
>>>>
>>>>>>>
>>>> [1]
>>>>>>>
>>>>>>
>>>>
>>>>>>>
>>>> https://github.com/apache/incubator-netbeans/pull/465
>>>>>>>
>>>>>>
>>>>
>>>>>>>
>>>> [2]
>>>>>>>
>>>>>>
>>>>
>>>>>>>
>>>> https://gist.github.com/ocafebabe/c94109fbd60c193719f0ccd65472b9e7
>>>>>>>
>>>>>>
>>>> ---------------------------------------------------------------------
>>>>
>>>> To unsubscribe, e-mail: dev-unsubscribe@netbeans.incubator.apache.org
>>>>
>>>> For additional commands, e-mail: dev-help@netbeans.incubator.apache.org
>>>>
>>>> For further information about the NetBeans mailing lists, visit:
>>>>
>>>> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>>>>
>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@netbeans.incubator.apache.org
>> For additional commands, e-mail: dev-help@netbeans.incubator.apache.org
>>
>> For further information about the NetBeans mailing lists, visit:
>> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>>
>>
>>
>>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@netbeans.incubator.apache.org
> For additional commands, e-mail: dev-help@netbeans.incubator.apache.org
>
> For further information about the NetBeans mailing lists, visit:
> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>
>
>
>

Re: NetBeans and OSGi bundle/dependencies

Posted by Antonio <an...@vieiro.net>.
Hi,

AFAIR extexecution.process & libs.osgi use the "-javac.init" task to 
patch sources, compile them and package a final jar file to use as an 
external binary.

It seems there's an ongoing PR to post-process downloaded binaries [1]. 
I think this may be a better alternative to the "-javac.init" task for 
this use case.

Cheers,
Antonio


[1]
https://github.com/apache/incubator-netbeans/pull/491


On 04/05/18 09:46, Emilian Bold wrote:
> The link does load for me but it doesn't really help you with a hook.
> 
> I found ./extexecution.process/build.xml which does some dependency patch and recompile.
> 
> Also ./libs.osgi/build.xml
> 
> --emi
> 
> ‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
> 
> On 4 May 2018 4:12 AM, Christian Bourque <ch...@gmail.com> wrote:
> 
>> There is a comment in the default build template file (nbbuild/templates/projectized.xml):
>>
>> <!-- See: http://wiki.netbeans.org/wiki/view/DevFaqExternalLibrariesUpdated -->
>>
>> It seems very interesting for my use case but the page content appears to be broken?!
>>
>> On Thu, May 3, 2018 at 7:50 PM, Emilian Bold <em...@protonmail.ch> wrote:
>>
>>>> The other option, as Emilian suggested, would be to repackage the JGit> library ourselves (without the OSGi stuff) but I'm unsure about how this> would work (licence-wise)!I don't believe it would be much problem licensing-wise.
>>>
>>> I remember NetBeans build already doing some repackaging for some dependencies (can't remember which!).
>>>
>>> Something as basic as re-zipping the JAR with a changed MANIFEST.MF file shouldn't be a problem. There certainly is some hook in the Ant build where we can do this post-processing.
>>>
>>> --emi
>>>
>>> ‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
>>>
>>> On 4 May 2018 2:22 AM, Christian Bourque <ch...@gmail.com> wrote:
>>>
>>>> IMHO, the logical solution would be to use the Eclipse artefacts directly
>>>
>>>>
>>>
>>>> and as is, but unfortunately they aren't pushed to Maven central...
>>>
>>>>
>>>
>>>> I asked the question to the JGit's lead developer and he then asked the
>>>
>>>>
>>>
>>>> mailing list here: [1]. It seems that they are only available in their
>>>
>>>>
>>>
>>>> Orbit P2 repository.
>>>
>>>>
>>>
>>>> Are you aware of a way to fetch an external dependency from such a
>>>
>>>>
>>>
>>>> repository in the NetBeans build harness?
>>>
>>>>
>>>
>>>> The other option, as Emilian suggested, would be to repackage the JGit
>>>
>>>>
>>>
>>>> library ourselves (without the OSGi stuff) but I'm unsure about how this
>>>
>>>>
>>>
>>>> would work (licence-wise)!
>>>
>>>>
>>>
>>>> Christian
>>>
>>>>
>>>
>>>> [1]
>>>
>>>>
>>>
>>>> https://dev.eclipse.org/mhonarc/lists/orbit-dev/msg04948.html
>>>
>>>>
>>>
>>>> On Tue, May 1, 2018 at 5:19 AM, Geertjan Wielenga <
>>>
>>>>
>>>
>>>> geertjan.wielenga@googlemail.com> wrote:
>>>
>>>>
>>>
>>>>> Thanks for this work and investigation you've done.
>>>
>>>>>
>>>
>>>>> What would to you be the ideal way to solve this?
>>>
>>>>>
>>>
>>>>> Thanks,
>>>
>>>>>
>>>
>>>>> Gj
>>>
>>>>>
>>>
>>>>> On Tue, May 1, 2018 at 2:28 AM, Christian Bourque <
>>>
>>>>>
>>>
>>>>> christian.bourque@gmail.com> wrote:
>>>
>>>>>
>>>
>>>>>> Hey guys,
>>>
>>>>>>
>>>
>>>>>> A month ago, I submitted a PR [1] to the project regarding the upgrade of
>>>
>>>>>>
>>>
>>>>>> the NetBeans JGit library to the latest version to benefit from the
>>>
>>>>>>
>>>
>>>>>> latest
>>>
>>>>>>
>>>
>>>>>> Git features.
>>>
>>>>>>
>>>
>>>>>> During the reviewing process, Emilian Bold raised some concerns about my
>>>
>>>>>>
>>>
>>>>>> request regarding the new dependencies required by the latest JGit
>>>
>>>>>>
>>>
>>>>>> version
>>>
>>>>>>
>>>
>>>>>> and he recommended that I bring this discussion to a wider audience on
>>>
>>>>>>
>>>
>>>>>> the
>>>
>>>>>>
>>>
>>>>>> mailing list.
>>>
>>>>>>
>>>
>>>>>> The main issue here is that JGit now depends on some external OSGi
>>>
>>>>>>
>>>
>>>>>> dependencies that aren't already provided by NetBeans (like JSCH and SL4J
>>>
>>>>>>
>>>
>>>>>> for instance). NetBeans already provides some of them like the JSCH
>>>
>>>>>>
>>>
>>>>>> dependency but since it's not an OSGi bundle it doesn't work (see this
>>>
>>>>>>
>>>
>>>>>> exception for more details [2]). Now I may be wrong, but from what I've
>>>
>>>>>>
>>>
>>>>>> read about the NetBeans OSGi bridge (Netigso / Netbinox), as soon as it
>>>
>>>>>>
>>>
>>>>>> sees a library with a manifest entry containing a bundle reference (like
>>>
>>>>>>
>>>
>>>>>> in
>>>
>>>>>>
>>>
>>>>>> JGit's case), it will add the said library to a list that will then be
>>>
>>>>>>
>>>
>>>>>> handled by the Equinox container. So I guess the previous error is to be
>>>
>>>>>>
>>>
>>>>>> expected in such cases.
>>>
>>>>>>
>>>
>>>>>> In the end, I was able to circumvent the problem by switching to OSGi
>>>
>>>>>>
>>>
>>>>>> bundles for these dependencies (both repackaged by Apache) and it works
>>>
>>>>>>
>>>
>>>>>> but
>>>
>>>>>>
>>>
>>>>>> I understand that it may not be the most proper and elegant solution.
>>>
>>>>>>
>>>
>>>>>> I guess this raises the following question: what would be the best way to
>>>
>>>>>>
>>>
>>>>>> solve this kind of issue?
>>>
>>>>>>
>>>
>>>>>> Thanks,
>>>
>>>>>>
>>>
>>>>>> Christian
>>>
>>>>>>
>>>
>>>>>> [1]
>>>
>>>>>>
>>>
>>>>>> https://github.com/apache/incubator-netbeans/pull/465
>>>
>>>>>>
>>>
>>>>>> [2]
>>>
>>>>>>
>>>
>>>>>> https://gist.github.com/ocafebabe/c94109fbd60c193719f0ccd65472b9e7
>>>
>>> ---------------------------------------------------------------------
>>>
>>> To unsubscribe, e-mail: dev-unsubscribe@netbeans.incubator.apache.org
>>>
>>> For additional commands, e-mail: dev-help@netbeans.incubator.apache.org
>>>
>>> For further information about the NetBeans mailing lists, visit:
>>>
>>> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@netbeans.incubator.apache.org
> For additional commands, e-mail: dev-help@netbeans.incubator.apache.org
> 
> For further information about the NetBeans mailing lists, visit:
> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
> 
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@netbeans.incubator.apache.org
For additional commands, e-mail: dev-help@netbeans.incubator.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists




Re: NetBeans and OSGi bundle/dependencies

Posted by Emilian Bold <em...@protonmail.ch>.
The link does load for me but it doesn't really help you with a hook.

I found ./extexecution.process/build.xml which does some dependency patch and recompile.

Also ./libs.osgi/build.xml

--emi

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐

On 4 May 2018 4:12 AM, Christian Bourque <ch...@gmail.com> wrote:

> There is a comment in the default build template file (nbbuild/templates/projectized.xml):
> 
> <!-- See: http://wiki.netbeans.org/wiki/view/DevFaqExternalLibrariesUpdated -->
> 
> It seems very interesting for my use case but the page content appears to be broken?!
> 
> On Thu, May 3, 2018 at 7:50 PM, Emilian Bold <em...@protonmail.ch> wrote:
> 
> > > The other option, as Emilian suggested, would be to repackage the JGit> library ourselves (without the OSGi stuff) but I'm unsure about how this> would work (licence-wise)!I don't believe it would be much problem licensing-wise.
> > 
> > I remember NetBeans build already doing some repackaging for some dependencies (can't remember which!).
> > 
> > Something as basic as re-zipping the JAR with a changed MANIFEST.MF file shouldn't be a problem. There certainly is some hook in the Ant build where we can do this post-processing.
> > 
> > --emi
> > 
> > ‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
> > 
> > On 4 May 2018 2:22 AM, Christian Bourque <ch...@gmail.com> wrote:
> > 
> > > IMHO, the logical solution would be to use the Eclipse artefacts directly
> > 
> > >
> > 
> > > and as is, but unfortunately they aren't pushed to Maven central...
> > 
> > >
> > 
> > > I asked the question to the JGit's lead developer and he then asked the
> > 
> > >
> > 
> > > mailing list here: [1]. It seems that they are only available in their
> > 
> > >
> > 
> > > Orbit P2 repository.
> > 
> > >
> > 
> > > Are you aware of a way to fetch an external dependency from such a
> > 
> > >
> > 
> > > repository in the NetBeans build harness?
> > 
> > >
> > 
> > > The other option, as Emilian suggested, would be to repackage the JGit
> > 
> > >
> > 
> > > library ourselves (without the OSGi stuff) but I'm unsure about how this
> > 
> > >
> > 
> > > would work (licence-wise)!
> > 
> > >
> > 
> > > Christian
> > 
> > >
> > 
> > > [1]
> > 
> > >
> > 
> > > https://dev.eclipse.org/mhonarc/lists/orbit-dev/msg04948.html
> > 
> > >
> > 
> > > On Tue, May 1, 2018 at 5:19 AM, Geertjan Wielenga <
> > 
> > >
> > 
> > > geertjan.wielenga@googlemail.com> wrote:
> > 
> > >
> > 
> > > > Thanks for this work and investigation you've done.
> > 
> > > >
> > 
> > > > What would to you be the ideal way to solve this?
> > 
> > > >
> > 
> > > > Thanks,
> > 
> > > >
> > 
> > > > Gj
> > 
> > > >
> > 
> > > > On Tue, May 1, 2018 at 2:28 AM, Christian Bourque <
> > 
> > > >
> > 
> > > > christian.bourque@gmail.com> wrote:
> > 
> > > >
> > 
> > > > > Hey guys,
> > 
> > > > >
> > 
> > > > > A month ago, I submitted a PR [1] to the project regarding the upgrade of
> > 
> > > > >
> > 
> > > > > the NetBeans JGit library to the latest version to benefit from the
> > 
> > > > >
> > 
> > > > > latest
> > 
> > > > >
> > 
> > > > > Git features.
> > 
> > > > >
> > 
> > > > > During the reviewing process, Emilian Bold raised some concerns about my
> > 
> > > > >
> > 
> > > > > request regarding the new dependencies required by the latest JGit
> > 
> > > > >
> > 
> > > > > version
> > 
> > > > >
> > 
> > > > > and he recommended that I bring this discussion to a wider audience on
> > 
> > > > >
> > 
> > > > > the
> > 
> > > > >
> > 
> > > > > mailing list.
> > 
> > > > >
> > 
> > > > > The main issue here is that JGit now depends on some external OSGi
> > 
> > > > >
> > 
> > > > > dependencies that aren't already provided by NetBeans (like JSCH and SL4J
> > 
> > > > >
> > 
> > > > > for instance). NetBeans already provides some of them like the JSCH
> > 
> > > > >
> > 
> > > > > dependency but since it's not an OSGi bundle it doesn't work (see this
> > 
> > > > >
> > 
> > > > > exception for more details [2]). Now I may be wrong, but from what I've
> > 
> > > > >
> > 
> > > > > read about the NetBeans OSGi bridge (Netigso / Netbinox), as soon as it
> > 
> > > > >
> > 
> > > > > sees a library with a manifest entry containing a bundle reference (like
> > 
> > > > >
> > 
> > > > > in
> > 
> > > > >
> > 
> > > > > JGit's case), it will add the said library to a list that will then be
> > 
> > > > >
> > 
> > > > > handled by the Equinox container. So I guess the previous error is to be
> > 
> > > > >
> > 
> > > > > expected in such cases.
> > 
> > > > >
> > 
> > > > > In the end, I was able to circumvent the problem by switching to OSGi
> > 
> > > > >
> > 
> > > > > bundles for these dependencies (both repackaged by Apache) and it works
> > 
> > > > >
> > 
> > > > > but
> > 
> > > > >
> > 
> > > > > I understand that it may not be the most proper and elegant solution.
> > 
> > > > >
> > 
> > > > > I guess this raises the following question: what would be the best way to
> > 
> > > > >
> > 
> > > > > solve this kind of issue?
> > 
> > > > >
> > 
> > > > > Thanks,
> > 
> > > > >
> > 
> > > > > Christian
> > 
> > > > >
> > 
> > > > > [1]
> > 
> > > > >
> > 
> > > > > https://github.com/apache/incubator-netbeans/pull/465
> > 
> > > > >
> > 
> > > > > [2]
> > 
> > > > >
> > 
> > > > > https://gist.github.com/ocafebabe/c94109fbd60c193719f0ccd65472b9e7
> > 
> > ---------------------------------------------------------------------
> > 
> > To unsubscribe, e-mail: dev-unsubscribe@netbeans.incubator.apache.org
> > 
> > For additional commands, e-mail: dev-help@netbeans.incubator.apache.org
> > 
> > For further information about the NetBeans mailing lists, visit:
> > 
> > https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@netbeans.incubator.apache.org
For additional commands, e-mail: dev-help@netbeans.incubator.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists




Re: NetBeans and OSGi bundle/dependencies

Posted by Christian Bourque <ch...@gmail.com>.
There is a comment in the default build template file
(nbbuild/templates/projectized.xml):

<!-- See: http://wiki.netbeans.org/wiki/view/DevFaqExternalLibrariesUpdated
-->

It seems very interesting for my use case but the page content appears to
be broken?!



On Thu, May 3, 2018 at 7:50 PM, Emilian Bold <em...@protonmail.ch>
wrote:

> > The other option, as Emilian suggested, would be to repackage the JGit
> > library ourselves (without the OSGi stuff) but I'm unsure about how this
> > would work (licence-wise)!
>
> I don't believe it would be much problem licensing-wise.
>
> I remember NetBeans build already doing some repackaging for some
> dependencies (can't remember which!).
>
> Something as basic as re-zipping the JAR with a changed MANIFEST.MF file
> shouldn't be a problem. There certainly is some hook in the Ant build where
> we can do this post-processing.
>
> --emi
>
> ‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
>
> On 4 May 2018 2:22 AM, Christian Bourque <ch...@gmail.com>
> wrote:
>
> > IMHO, the logical solution would be to use the Eclipse artefacts directly
> >
> > and as is, but unfortunately they aren't pushed to Maven central...
> >
> > I asked the question to the JGit's lead developer and he then asked the
> >
> > mailing list here: [1]. It seems that they are only available in their
> >
> > Orbit P2 repository.
> >
> > Are you aware of a way to fetch an external dependency from such a
> >
> > repository in the NetBeans build harness?
> >
> > The other option, as Emilian suggested, would be to repackage the JGit
> >
> > library ourselves (without the OSGi stuff) but I'm unsure about how this
> >
> > would work (licence-wise)!
> >
> > Christian
> >
> > [1]
> >
> > https://dev.eclipse.org/mhonarc/lists/orbit-dev/msg04948.html
> >
> > On Tue, May 1, 2018 at 5:19 AM, Geertjan Wielenga <
> >
> > geertjan.wielenga@googlemail.com> wrote:
> >
> > > Thanks for this work and investigation you've done.
> > >
> > > What would to you be the ideal way to solve this?
> > >
> > > Thanks,
> > >
> > > Gj
> > >
> > > On Tue, May 1, 2018 at 2:28 AM, Christian Bourque <
> > >
> > > christian.bourque@gmail.com> wrote:
> > >
> > > > Hey guys,
> > > >
> > > > A month ago, I submitted a PR [1] to the project regarding the
> upgrade of
> > > >
> > > > the NetBeans JGit library to the latest version to benefit from the
> > > >
> > > > latest
> > > >
> > > > Git features.
> > > >
> > > > During the reviewing process, Emilian Bold raised some concerns
> about my
> > > >
> > > > request regarding the new dependencies required by the latest JGit
> > > >
> > > > version
> > > >
> > > > and he recommended that I bring this discussion to a wider audience
> on
> > > >
> > > > the
> > > >
> > > > mailing list.
> > > >
> > > > The main issue here is that JGit now depends on some external OSGi
> > > >
> > > > dependencies that aren't already provided by NetBeans (like JSCH and
> SL4J
> > > >
> > > > for instance). NetBeans already provides some of them like the JSCH
> > > >
> > > > dependency but since it's not an OSGi bundle it doesn't work (see
> this
> > > >
> > > > exception for more details [2]). Now I may be wrong, but from what
> I've
> > > >
> > > > read about the NetBeans OSGi bridge (Netigso / Netbinox), as soon as
> it
> > > >
> > > > sees a library with a manifest entry containing a bundle reference
> (like
> > > >
> > > > in
> > > >
> > > > JGit's case), it will add the said library to a list that will then
> be
> > > >
> > > > handled by the Equinox container. So I guess the previous error is
> to be
> > > >
> > > > expected in such cases.
> > > >
> > > > In the end, I was able to circumvent the problem by switching to OSGi
> > > >
> > > > bundles for these dependencies (both repackaged by Apache) and it
> works
> > > >
> > > > but
> > > >
> > > > I understand that it may not be the most proper and elegant solution.
> > > >
> > > > I guess this raises the following question: what would be the best
> way to
> > > >
> > > > solve this kind of issue?
> > > >
> > > > Thanks,
> > > >
> > > > Christian
> > > >
> > > > [1]
> > > >
> > > > https://github.com/apache/incubator-netbeans/pull/465
> > > >
> > > > [2]
> > > >
> > > > https://gist.github.com/ocafebabe/c94109fbd60c193719f0ccd65472b9e7
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@netbeans.incubator.apache.org
> For additional commands, e-mail: dev-help@netbeans.incubator.apache.org
>
> For further information about the NetBeans mailing lists, visit:
> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>
>
>
>

Re: NetBeans and OSGi bundle/dependencies

Posted by Emilian Bold <em...@protonmail.ch>.
> The other option, as Emilian suggested, would be to repackage the JGit
> library ourselves (without the OSGi stuff) but I'm unsure about how this
> would work (licence-wise)!

I don't believe it would be much problem licensing-wise.

I remember NetBeans build already doing some repackaging for some dependencies (can't remember which!).

Something as basic as re-zipping the JAR with a changed MANIFEST.MF file shouldn't be a problem. There certainly is some hook in the Ant build where we can do this post-processing.

--emi

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐

On 4 May 2018 2:22 AM, Christian Bourque <ch...@gmail.com> wrote:

> IMHO, the logical solution would be to use the Eclipse artefacts directly
> 
> and as is, but unfortunately they aren't pushed to Maven central...
> 
> I asked the question to the JGit's lead developer and he then asked the
> 
> mailing list here: [1]. It seems that they are only available in their
> 
> Orbit P2 repository.
> 
> Are you aware of a way to fetch an external dependency from such a
> 
> repository in the NetBeans build harness?
> 
> The other option, as Emilian suggested, would be to repackage the JGit
> 
> library ourselves (without the OSGi stuff) but I'm unsure about how this
> 
> would work (licence-wise)!
> 
> Christian
> 
> [1]
> 
> https://dev.eclipse.org/mhonarc/lists/orbit-dev/msg04948.html
> 
> On Tue, May 1, 2018 at 5:19 AM, Geertjan Wielenga <
> 
> geertjan.wielenga@googlemail.com> wrote:
> 
> > Thanks for this work and investigation you've done.
> > 
> > What would to you be the ideal way to solve this?
> > 
> > Thanks,
> > 
> > Gj
> > 
> > On Tue, May 1, 2018 at 2:28 AM, Christian Bourque <
> > 
> > christian.bourque@gmail.com> wrote:
> > 
> > > Hey guys,
> > > 
> > > A month ago, I submitted a PR [1] to the project regarding the upgrade of
> > > 
> > > the NetBeans JGit library to the latest version to benefit from the
> > > 
> > > latest
> > > 
> > > Git features.
> > > 
> > > During the reviewing process, Emilian Bold raised some concerns about my
> > > 
> > > request regarding the new dependencies required by the latest JGit
> > > 
> > > version
> > > 
> > > and he recommended that I bring this discussion to a wider audience on
> > > 
> > > the
> > > 
> > > mailing list.
> > > 
> > > The main issue here is that JGit now depends on some external OSGi
> > > 
> > > dependencies that aren't already provided by NetBeans (like JSCH and SL4J
> > > 
> > > for instance). NetBeans already provides some of them like the JSCH
> > > 
> > > dependency but since it's not an OSGi bundle it doesn't work (see this
> > > 
> > > exception for more details [2]). Now I may be wrong, but from what I've
> > > 
> > > read about the NetBeans OSGi bridge (Netigso / Netbinox), as soon as it
> > > 
> > > sees a library with a manifest entry containing a bundle reference (like
> > > 
> > > in
> > > 
> > > JGit's case), it will add the said library to a list that will then be
> > > 
> > > handled by the Equinox container. So I guess the previous error is to be
> > > 
> > > expected in such cases.
> > > 
> > > In the end, I was able to circumvent the problem by switching to OSGi
> > > 
> > > bundles for these dependencies (both repackaged by Apache) and it works
> > > 
> > > but
> > > 
> > > I understand that it may not be the most proper and elegant solution.
> > > 
> > > I guess this raises the following question: what would be the best way to
> > > 
> > > solve this kind of issue?
> > > 
> > > Thanks,
> > > 
> > > Christian
> > > 
> > > [1]
> > > 
> > > https://github.com/apache/incubator-netbeans/pull/465
> > > 
> > > [2]
> > > 
> > > https://gist.github.com/ocafebabe/c94109fbd60c193719f0ccd65472b9e7



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@netbeans.incubator.apache.org
For additional commands, e-mail: dev-help@netbeans.incubator.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists




Re: NetBeans and OSGi bundle/dependencies

Posted by Christian Bourque <ch...@gmail.com>.
IMHO, the logical solution would be to use the Eclipse artefacts directly
and as is, but unfortunately they aren't pushed to Maven central...
I asked the question to the JGit's lead developer and he then asked the
mailing list here: [1]. It seems that they are only available in their
Orbit P2 repository.
Are you aware of a way to fetch an external dependency from such a
repository in the NetBeans build harness?

The other option, as Emilian suggested, would be to repackage the JGit
library ourselves (without the OSGi stuff) but I'm unsure about how this
would work (licence-wise)!

Christian

[1]
https://dev.eclipse.org/mhonarc/lists/orbit-dev/msg04948.html

On Tue, May 1, 2018 at 5:19 AM, Geertjan Wielenga <
geertjan.wielenga@googlemail.com> wrote:

> Thanks for this work and investigation you've done.
>
> What would to you be the ideal way to solve this?
>
> Thanks,
>
> Gj
>
>
> On Tue, May 1, 2018 at 2:28 AM, Christian Bourque <
> christian.bourque@gmail.com> wrote:
>
> > Hey guys,
> >
> >
> > A month ago, I submitted a PR [1] to the project regarding the upgrade of
> > the NetBeans JGit library to the latest version to benefit from the
> latest
> > Git features.
> >
> >
> > During the reviewing process, Emilian Bold raised some concerns about my
> > request regarding the new dependencies required by the latest JGit
> version
> > and he recommended that I bring this discussion to a wider audience on
> the
> > mailing list.
> >
> >
> > The main issue here is that JGit now depends on some external OSGi
> > dependencies that aren't already provided by NetBeans (like JSCH and SL4J
> > for instance). NetBeans already provides some of them like the JSCH
> > dependency but since it's not an OSGi bundle it doesn't work (see this
> > exception for more details [2]). Now I may be wrong, but from what I've
> > read about the NetBeans OSGi bridge (Netigso / Netbinox), as soon as it
> > sees a library with a manifest entry containing a bundle reference (like
> in
> > JGit's case), it will add the said library to a list that will then be
> > handled by the Equinox container. So I guess the previous error is to be
> > expected in such cases.
> >
> >
> > In the end, I was able to circumvent the problem by switching to OSGi
> > bundles for these dependencies (both repackaged by Apache) and it works
> but
> > I understand that it may not be the most proper and elegant solution.
> >
> >
> > I guess this raises the following question: what would be the best way to
> > solve this kind of issue?
> >
> >
> > Thanks,
> >
> >
> > Christian
> >
> > [1]
> > https://github.com/apache/incubator-netbeans/pull/465
> >
> > [2]
> > https://gist.github.com/ocafebabe/c94109fbd60c193719f0ccd65472b9e7
> >
>

Re: NetBeans and OSGi bundle/dependencies

Posted by Geertjan Wielenga <ge...@googlemail.com>.
Thanks for this work and investigation you've done.

What would to you be the ideal way to solve this?

Thanks,

Gj


On Tue, May 1, 2018 at 2:28 AM, Christian Bourque <
christian.bourque@gmail.com> wrote:

> Hey guys,
>
>
> A month ago, I submitted a PR [1] to the project regarding the upgrade of
> the NetBeans JGit library to the latest version to benefit from the latest
> Git features.
>
>
> During the reviewing process, Emilian Bold raised some concerns about my
> request regarding the new dependencies required by the latest JGit version
> and he recommended that I bring this discussion to a wider audience on the
> mailing list.
>
>
> The main issue here is that JGit now depends on some external OSGi
> dependencies that aren't already provided by NetBeans (like JSCH and SL4J
> for instance). NetBeans already provides some of them like the JSCH
> dependency but since it's not an OSGi bundle it doesn't work (see this
> exception for more details [2]). Now I may be wrong, but from what I've
> read about the NetBeans OSGi bridge (Netigso / Netbinox), as soon as it
> sees a library with a manifest entry containing a bundle reference (like in
> JGit's case), it will add the said library to a list that will then be
> handled by the Equinox container. So I guess the previous error is to be
> expected in such cases.
>
>
> In the end, I was able to circumvent the problem by switching to OSGi
> bundles for these dependencies (both repackaged by Apache) and it works but
> I understand that it may not be the most proper and elegant solution.
>
>
> I guess this raises the following question: what would be the best way to
> solve this kind of issue?
>
>
> Thanks,
>
>
> Christian
>
> [1]
> https://github.com/apache/incubator-netbeans/pull/465
>
> [2]
> https://gist.github.com/ocafebabe/c94109fbd60c193719f0ccd65472b9e7
>