Skip to content

Adding a new bundle to Kura

Marcello Rinaldo Martina edited this page Dec 1, 2021 · 3 revisions

Adding a new Kura bundle to the Kura distribution requires:

  1. Add the project itself to the kura directory. As an example we will use the org.eclipse.kura.filesystem.logprovider bundle.
  2. Add the project to the <modules> list in kura/pom.xml.
    Example:
    <module>org.eclipse.kura.log.filesystem.provider</module>
    
  3. In kura/distrib/config/kura.build.properties add the bundle and Maven version to the list.
    Example:
    org.eclipse.kura.log.filesystem.provider.version=1.0.0-SNAPSHOT
    
  4. Edit kura/distrib/pom.xml:
    • Add the dependency to the artifactItem list.
      Example:
      <artifactItem>
          <groupId>org.eclipse.kura</groupId>
          <artifactId>org.eclipse.kura.log.filesystem.provider</artifactId>
          <version>${org.eclipse.kura.log.filesystem.provider.version}</version>
      </artifactItem>
      
    • Add the file to the move list.
      Example:
      <move file="target/plugins/org.eclipse.kura.log.filesystem.provider.jar"
           tofile="target/plugins/org.eclipse.kura.log.filesystem.provider_${org.eclipse.kura.log.filesystem.provider.version}.jar" />
      
    • Do the same to the copy list. If you need to have this bundle in the emulator or the dev-env, then edit the proper sections.
  5. Edit kura/distrib/src/main/ant/build_equinox_distrib.xml:
    • Add an antcall with the config reference.
      Example:
      <!-- Filesystem log provider bundle config -->
      <antcall target="filesystem-logprovider-config" />
      
    • Add an antcall for the jar reference.
      Example:
      <antcall target="filesystem-logprovider-jar" />
      
    • Add a zip entry to one of the jar targets.
      Example:
      <target name="filesystem-logprovider-config">
          <propertyfile
          file="${project.build.directory}/${build.output.name}/config.ini">
              <entry key="osgi.bundles" operation="+"
              value=", reference:file:${kura.install.dir}/${kura.symlink}/${plugins.folder}/org.eclipse.kura.log.filesystem.provider_${org.eclipse.kura.log.filesystem.provider.version}.jar@4:start" />
          </propertyfile>
      </target>
      <target name="filesystem-logprovider-jar">
          <zip destfile="${project.build.directory}/${build.output.name}.zip"
           update="true">
          <zipfileset
              file="${project.build.directory}/plugins/org.eclipse.kura.log.filesystem.provider_${org.eclipse.kura.log.filesystem.provider.version}.jar" prefix="${build.output.name}/${plugins.folder}" />
          </zip>
      </target>
      

Old resource also suggests to:

  • Add a copy to one of the jar-win targets.
  • Edit karaf/features.
  • Add this bundle with its maven coordinates to one of the features (runtime, core, linux).
Clone this wiki locally