Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Building OSGi Projects with bnd in Maven -- Ray Augé, Liferay

14 views

Published on

The Bndtools.org team has spent a number of years focused on improving support for OSGi development in Maven. This presentation covers the latest innovations demonstrating features such as quick setup, minimal configuration, use of bundle annotations, BOM support, testing and running.

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Building OSGi Projects with bnd in Maven -- Ray Augé, Liferay

  1. 1. � � � Building OSGi Projects with Bnd in Maven Raymond Aug� - Sr. So ware Architect @rotty3000
  2. 2. Existing maven OSGi Tools Apache Felix maven-bundle-plugin Eclipse Tycho Bndtools.org bnd*-maven-plugin ... note there are a number of gradle plugins for OSGi, including ones from bnd @rotty3000
  3. 3. maven-bundle-plugin most widely adopted tool for working with OSGi across the Java ecosystem still very relevant because keeping pace with underlying bnd dependency supports additional functionalities like deploying bundles to OSGi repositories and baseline @rotty3000
  4. 4. Eclipse Tycho focused on a manifest-first approach associated primarily with building Eclipse RCP applications and Eclipse plugins using PDE @rotty3000
  5. 5. bnd*-maven-plugin state of the art OSGi development provided by a suite of plugins each one focused on an individual aspect designed to be composed to meet developer needs @rotty3000
  6. 6. bnd-maven-plugin the core plugin, used to generate manifest and other metadata for projects that build an OSGi bundle @rotty3000
  7. 7. setup @rotty3000 <plugin> <groupId>biz.aQute.bnd</groupId> <artifactId>bnd-maven-plugin</artifactId> <executions> <execution> <id>bnd-process</id> <goals><goal>bnd-process</goal></goals> </execution> </executions> </plugin> 1 2 3 4 5 6 7 8 9 10
  8. 8. configuring manifest @rotty3000 <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jar-plugin</artifactId> <configuration> <archive> <manifestFile> ${project.build.outputDirectory}/META- INF/MANIFEST.MF </manifestFile> </archive> </configuration> </plugin> 1 2 3 4 5 6 7 8 9 10 11
  9. 9. bnd-indexer-maven-plugin used to generate an OSGi repository index from a set of Maven dependencies. The entries in the index will reference the location of the bundles in the remote repositories to which they have been deployed @rotty3000
  10. 10. setup @rotty3000 <plugin> <groupId>biz.aQute.bnd</groupId> <artifactId>bnd-indexer-maven-plugin</artifactId> <configuration>...</configuration> <executions> <execution> <id>index</id> <goals><goal>...</goal></goals> </execution> </executions> </plugin> 1 2 3 4 5 6 7 8 9 10 11
  11. 11. variety of indexing options index - generates OSGi index output files which are attached as deployable artifacts local-index - generates OSGi index output files which are not attached as deployable artifacts local vs. external urls selection of scopes from which to select artifacts to index transitivity @rotty3000
  12. 12. bnd-baseline-maven-plugin plugin used to validate that a bundle correctly uses semantic versioning as described by the OSGi Alliance ... and not semver.org @rotty3000
  13. 13. setup @rotty3000 <plugin> <groupId>biz.aQute.bnd</groupId> <artifactId>bnd-baseline-maven-plugin</artifactId> <configuration>...</configuration> <executions> <execution> <id>baseline</id> <goals><goal>baseline</goal></goals> </execution> </executions> </plugin> 1 2 3 4 5 6 7 8 9 10 11
  14. 14. bnd-export-maven-plugin plugin to export bndrun files, OOTB as: bundles in a directory an executable jar an OSGi subsystem bundle ... plugable export SPI @rotty3000
  15. 15. setup @rotty3000 <plugin> <groupId>biz.aQute.bnd</groupId> <artifactId>bnd-export-maven-plugin</artifactId> <configuration>...</configuration> <executions> <execution> <id>export</id> <goals><goal>export</goal></goals> </execution> </executions> </plugin> 1 2 3 4 5 6 7 8 9 10 11
  16. 16. bnd-resolver-maven-plugin plugin to resolve bndrun files ... verification that all requirements are satisfied @rotty3000
  17. 17. setup @rotty3000 <plugin> <groupId>biz.aQute.bnd</groupId> <artifactId>bnd-resolver-maven-plugin</artifactId> <configuration>...</configuration> <executions> <execution> <id>resolve</id> <goals><goal>resolve</goal></goals> </execution> </executions> </plugin> 1 2 3 4 5 6 7 8 9 10 11
  18. 18. bnd-testing-maven-plugin plugin to run integration tests from bndrun files @rotty3000
  19. 19. setup @rotty3000 <plugin> <groupId>biz.aQute.bnd</groupId> <artifactId>bnd-testing-maven-plugin</artifactId> <configuration>...</configuration> <executions> <execution> <id>testing</id> <goals><goal>testing</goal></goals> </execution> </executions> </plugin> 1 2 3 4 5 6 7 8 9 10 11
  20. 20. bnd-run-maven-plugin plugin to run a bndrun file @rotty3000
  21. 21. setup @rotty3000 <plugin> <groupId>biz.aQute.bnd</groupId> <artifactId>bnd-run-maven-plugin</artifactId> <configuration>...</configuration> <executions> <execution> <id>run</id> <goals><goal>run</goal></goals> </execution> </executions> </plugin> 1 2 3 4 5 6 7 8 9 10 11
  22. 22. bnd-reporter-maven-plugin plugin to generate and export reports of projects @rotty3000
  23. 23. setup @rotty3000 � <plugin> <groupId>biz.aQute.bnd</groupId> <artifactId>bnd-reporter-maven-plugin</artifactId> <configuration>...</configuration> </plugin> 1 2 3 4 5

×