Note that BJ is referencing one possible way to use the 
bnd-resolver-maven-plugin and bnd-export-maven-plugin.

The enRoute projects set up their bndrun files to use standalone indexes 
generated by the bnd-indexer-maven-plugin. These indexes are generated using 
the dependencies from the pom file of the project. The benefit of this solution 
is that indexes can be generated for different dependency scopes, for example a 
testing index is generated which includes test-scoped dependencies. This index 
is then used by the debug bndrun to include things like the Felix Gogo shell 
and the Felix Web console, which are good for debugging, but should not be 
available when resolving/deploying a production application.

To answer your original question, therefore:

> It seems, if we create an OSGI project we have to add dependencies to maven 
> or gradle pom.xml build.gradle then we have add dependencies to our composite 
> application .bndrun file.
> 

Adding the dependencies to your pom.xml is a necessary step. This is because 
the transitive dependency graph of your project determines the set of bundles 
that are available to the resolve and export operations. Also adding a 
dependency to your pom.xml does not require anything to be added to your bndrun 
file (although it may change the output of your next call to the resolver).

The requirement that you add to your bndrun is different and is not about 
declaring dependencies. The bndrun runrequire instruction exists to define the 
outer surface and structure of your application, which can be further 
fine-tuned using blacklisting and other instructions. The closest analogy in a 
non-OSGi project would be an assembly descriptor for the maven-assembly plugin. 
The purpose of the bndrun is therefore to define the complete set of bundles 
make up your application, with the bnd-resolver-maven-plugin using your run 
requirements to generate that list for you. In general your run requirements 
list should be very small (often only one requirement), and not need updating 
even if the pom dependencies change.

Hopefully this explanation helps you to see the difference between the two 
files and what they are trying to achieve.

Best Regards,

Tim

> On 27 Jul 2018, at 15:37, BJ Hargrave via osgi-dev <osgi-dev@mail.osgi.org> 
> wrote:
> 
> Well you, the developer, write the requirements (-runrequire) and the 
> bnd-resolver-maven-plugin can resolve these requirements into a set of 
> bundles (-runbundles). The resolver process will have access to the maven 
> project dependencies (via a FileSetRepository) to resolve the requirements 
> into a set of bundles.
>  
> See 
> https://github.com/osgi/osgi.enroute/tree/master/examples/microservice/rest-service-test
>  
> <https://github.com/osgi/osgi.enroute/tree/master/examples/microservice/rest-service-test>.
>  This project has a bndrun with -runrequires and the pom configures the 
> bnd-resolver-maven-plugin for the project. See 
> https://enroute.osgi.org/examples/020-examples-microservice.html#the-integration-testbndrun
>  
> <https://enroute.osgi.org/examples/020-examples-microservice.html#the-integration-testbndrun>
>  for some information on this.
> --
> 
> BJ Hargrave
> Senior Technical Staff Member, IBM // office: +1 386 848 1781
> OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788
> hargr...@us.ibm.com
>  
>  
> ----- Original message -----
> From: "Matthews, Kevin" <kevin.matth...@firstdata.com>
> To: BJ Hargrave <hargr...@us.ibm.com>
> Cc: "osgi-dev@mail.osgi.org" <osgi-dev@mail.osgi.org>
> Subject: RE: [osgi-dev] OSGI enroute bndrun file
> Date: Fri, Jul 27, 2018 10:21 AM
>  
> Thanks BJ. So, there is a bnd plugin referencing the FileSetRepository using 
> the new enroute to write bundle(s) run time requirements to the bndrun file? 
> Because I still have add my bundle dependencies/versions in this file. I 
> think there are bnd plugins that resolve and validates the component 
> dependencies for wiring.
> 
>  
> 
> From: BJ Hargrave [mailto:hargr...@us.ibm.com]
> Sent: Friday, July 27, 2018 10:04 AM
> To: Matthews, Kevin
> Cc: osgi-dev@mail.osgi.org
> Subject: RE: [osgi-dev] OSGI enroute bndrun file
> 
>  
> 
> Well enRoute is currently maven based and uses the Bnd maven plugins which 
> themselves use the FileSetRepository. One of the links was to one of the Bnd 
> maven plugins using it. So you don't need to do anything to use this support. 
> It is part of the maven and gradle plugin's support.
> 
>  
> 
> --
> 
> BJ Hargrave
> Senior Technical Staff Member, IBM // office: +1 386 848 1781
> OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788
> hargr...@us.ibm.com
> 
>  
> 
>  
> 
> ----- Original message -----
> From: "Matthews, Kevin" <kevin.matth...@firstdata.com>
> To: BJ Hargrave <hargr...@us.ibm.com>, "osgi-dev@mail.osgi.org" 
> <osgi-dev@mail.osgi.org>
> Cc:
> Subject: RE: [osgi-dev] OSGI enroute bndrun file
> Date: Fri, Jul 27, 2018 8:31 AM
>  
> 
> How do we use these java and groovy file in enroute OSGI project?
> 
> For, gradle project do we reference FileSetRepositoryConvention  as task in 
> the build.gradle
> 
>  
> 
> From: BJ Hargrave [mailto:hargr...@us.ibm.com]
> Sent: Thursday, July 26, 2018 3:30 PM
> To: Matthews, Kevin; osgi-dev@mail.osgi.org
> Subject: Re: [osgi-dev] OSGI enroute bndrun file
> 
>  
> 
> The most recent versions of the gradle and maven support will make the 
> project's dependencies available as bundles to the bndrun files.
> 
>  
> 
> For example:
> 
> https://github.com/bndtools/bnd/blob/26db7e381621f87ac81810fffe86e0c2224a6af0/maven/bnd-export-maven-plugin/src/main/java/aQute/bnd/maven/export/plugin/ExportMojo.java#L107-L109
>  
> <https://github.com/bndtools/bnd/blob/26db7e381621f87ac81810fffe86e0c2224a6af0/maven/bnd-export-maven-plugin/src/main/java/aQute/bnd/maven/export/plugin/ExportMojo.java#L107-L109>
>  
> 
> and
> 
>  
> 
> https://github.com/bndtools/bnd/blob/26db7e381621f87ac81810fffe86e0c2224a6af0/biz.aQute.bnd.gradle/src/aQute/bnd/gradle/FileSetRepositoryConvention.groovy#L33-L36
>  
> <https://github.com/bndtools/bnd/blob/26db7e381621f87ac81810fffe86e0c2224a6af0/biz.aQute.bnd.gradle/src/aQute/bnd/gradle/FileSetRepositoryConvention.groovy#L33-L36>
>  
> 
> --
> 
> BJ Hargrave
> Senior Technical Staff Member, IBM // office: +1 386 848 1781
> OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788
> hargr...@us.ibm.com
> 
>  
> 
>  
> 
> ----- Original message -----
> From: "Matthews, Kevin via osgi-dev" <osgi-dev@mail.osgi.org>
> Sent by: osgi-dev-boun...@mail.osgi.org
> To: "osgi-dev@mail.osgi.org" <osgi-dev@mail.osgi.org>
> Cc:
> Subject: [osgi-dev] OSGI enroute bndrun file
> Date: Thu, Jul 26, 2018 3:05 PM
>  
> 
> Hello,
> 
>  
> 
> I would like to know will there be any change in the future to Enroute 
> project as to how we add dependencies to .bdnrun Requirements project. It 
> seems, if we create an OSGI project we have to add dependencies to maven or 
> gradle pom.xml build.gradle then we have add dependencies to our composite 
> application .bndrun file. Will there be in the future such as a maven plugin 
> or gradle plugin to automactically add transitive dependies to the .bndrun 
> file. Sometimes we have to maintain 2 files build management and run 
> requirements file and just to wire components can take time.
> 
>  
> 
> Kevin Matthews 
> Senior Application Analyst
> 
> First Data, 3975 NW 120 Ave, Coral Springs, FL 33065
> Office: 954-845-4222 | Mobile: 561-465-6694
> 
> kevin.matth...@firstdata.com <mailto:kevin.matth...@firstdata.com> | 
> firstdata.com 
> 
>  
> 
> The information in this message may be proprietary and/or confidential, and 
> protected from disclosure. If the reader of this message is not the intended 
> recipient, or an employee or agent responsible for delivering this message to 
> the intended recipient, you are hereby notified that any dissemination, 
> distribution or copying of this communication is strictly prohibited. If you 
> have received this communication in error, please notify First Data 
> immediately by replying to this message and deleting it from your computer.
> 
> _______________________________________________
> OSGi Developer Mail List
> osgi-dev@mail.osgi.org
> https://mail.osgi.org/mailman/listinfo/osgi-dev 
> <https://mail.osgi.org/mailman/listinfo/osgi-dev>
>  
> 
>  
> 
>  
> 
>  
> 
>  
> 
> _______________________________________________
> OSGi Developer Mail List
> osgi-dev@mail.osgi.org
> https://mail.osgi.org/mailman/listinfo/osgi-dev

_______________________________________________
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Reply via email to