Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Once installed, create a Java project to use the plug-in.

(fig1)Image Added

The new java project wizard appears. Enter the project name without spaces. Configure the Java project as you want.

(fig2)Image Added

Then, right click on the new project, go inside the iPOJO sub-menu and click on "create both files". This action will create two file in your java project. The $project_name.bnd file configure BND and contains the declaration of imported, private and exported packages. The second file (metadata.xml) contains the iPOJO bundle configuration.(fig3)

Image Added

As you create the two file, you should obtain something like :

(fig4)Image Added

Imagine that you implement a simple component displaying each message pushed inside the OSGi™ OSGi? Log Service. The following code snippet shows one possible implementation of this component :

...

Once all is complete, we can build the bundle by doing a right-click on the metadata.xml file. Then go to the iPOJO sub-menu and click on Create Bundle.

(fig 5)Image Added

If all is correctly configured, the following message appears, else warnings or errors are displayed in a message box too.

(fig 6)Image Added

Your project contains now the build bundle. The bundle has the same name as your project.

(fig 7)Image Added

Plug-in options

On Java project

(fig 8)Image Added

  • Create both files : create both the BND file and the metadata.xml file (replace existing one)

...

  • Create BND file : create only the BND file

On metadata.xml file

(fig 9)Image Added

  • Manipulate bundle: take an already created bundle and manipulate it. This option is use when you don't use BND to create a bundle
  • Create bundle: create a bundle "from scratch", first create a bundle with BND and then manipulate it.

Conclusion

This page has presented the iPOJO Eclipe plug-in. Do not hesite to send me comments or questions.