Skip to content

Mavenizing OSGi bundles

Andrey Hihlovskiy edited this page Jul 2, 2014 · 27 revisions

What "mavenizing" means? When Wuff mavenizes OSGi-bundles, it does the following:

  1. Wuff uses configuration property wuff/selectedEclipseVersion to decide which version of Eclipse must be downloaded and mavenized.

  2. Wuff automatically downloads and unpacks Eclipse distribution packages specified in configuration part wuff/eclipseVersion/sources. All downloaded and unpacked files are placed to wuff directory (default is "$HOME/.wuff"). We can change wuff directory by configuration property wuff/wuffDir.

  3. Wuff scans all JARs and subdirectories in unpacked distribution packages. Found OSGi bundles are processed furthermore.

  4. Wuff generates pom.xml for every OSGi-bundle. The generated pom.xml contains maven coordinates "group:artifact:version", where "group" is constant (specified as eclipseVersion/eclipseMavenGroup property), "artifact" corresponds to OSGi-bundle name, "version" corresponds to OSGi-bundle version.

  5. Wuff compares every required-bundle of the given OSGi-bundle against other mavenized OSGi-bundles and, when match found, converts it to maven dependency.

  6. When Wuff configuration contains one or more wuff/languagePack or wuff/eclipseVersion/languagePack instructions, Wuff automatically finds language-fragments of the given OSGi-bundle and adds them as optional maven dependencies.

  7. When Wuff configuration specifies source-code OSGi-bundles (of eclipse-SDK, for example), Wuff automatically adds them as source-jars to their master mavenized OSGi-bundles.

  8. Wuff automatically installs mavenized OSGi-bundles to local maven repository, by default: $HOME/.wuff/m2_repository. Installation is performed as soon as we try to compile Wuff-enabled project. We can customize the location of local maven repository by setting wuff/localMavenRepository property.

  9. Wuff implements the following gradle tasks for full control over mavenizing:

  • downloadEclipse: downloads the selected eclipse distribution to wuff directory.
  • installEclipse: installs the selected eclipse distribution to the local maven repository.
  • uninstallEclipse: uninstalls the selected eclipse distribution from the local maven repository.
  • uninstallAllEclipseVersions: uninstalls all eclipse distributions from the local maven repository.
  • uploadEclipse: uploads mavenized artifacts to the remote maven repository specified in uploadEclipse configuration.
  • purgeEclipse: uninstalls all eclipse distributions from the local maven repository, then deletes wuff directory.

As the result, we get complete and consistent representation of OSGi-bundles as a set of maven artifacts with dependencies.

Clone this wiki locally