Developers, Developers, Developers! Maksim Sorokin IT Blog


Maven + Apache Felix: Best Practices

This is another post in Maven + Apache Felix + CXF + DOSGi series. As was shown in Maven + Apache Felix: Easy Development and Debugging With Eclipse post, it is easy to develop projects with Maven and Apache Felix. But how about really big projects. How to maintain configuration and easily manage the bundles?

The answer is simple -- use the power of Maven. If you have really big projects, try to split them into different parents and modules. It is import during this splitting part to preserve some sort of naming convention. For example, each child preserves parent name as a prefix. In this case it is easier to identify and operate the projects. The structure may look like this, assuming that there is a generator project:

-- generator
 |-- generator.parser
   |-- generator.parser.full
     |-- generator.parser.full.noboms
     |-- generator.parser.full.universal
   |-- generator.parser.simple
   |-- generator.parser.utils
 |-- generator.utility

Also, do not forget that you can exploit pluginManagement and dependencyManagement in Maven. Using it you can predefine build process routine in your parent (typically the top one) and not care about it in your parents. Example would be something like:

<project xmlns="" xmlns:xsi=""


  <name>Generator Parent</name>










Also, carefully maintain Felix file. Especially, if you share it with several developers. In order not to have hardcoded path in it, you may use Maven Filtering to filtering it. Instead of paths, you have variables, which are stored in Maven Settings.

Finally, always make sure, that the whole project and Felix launcher (if you use it) can be checked, built and run immediately on the fresh machine.

Comments (0) Trackbacks (0)

Sorry, the comment form is closed at this time.

Trackbacks are disabled.