Appendix A. Eclipse, Maven, and Felix

Writing Java code can be fun with just a simple text editor like vi and javac to compile, at times. However, when the project grows bigger than just a few classes and starts having many dependencies, the need for an IDE, a dependency management, and a build process system become a must.

A good selection of tools that integrate well with one another improves the overall productivity while reducing the impact of human intervention in repetitive, day-to-day processes, which can be automated.

In this appendix, we will go over a short introduction to those tools. Then we'll look at a few ways to use Eclipse in the process of developing and testing Felix bundles and the Maven project setup for building and packaging them.

It is not supposed to be a complete overview of how to use Eclipse or Maven; so additional research and online reading will be required. However, it will give us some basics to help us to get going. Some of the more experienced developers will most probably just whiz through it looking for the main pointers.

In this appendix, you will learn how to:

  • Extend Eclipse with plugins that integrate it with Felix and Maven
  • Set up a new project using Eclipse and Maven
  • Configure the JVM launch options to set up a Felix framework for remote debugging
  • Configure Eclipse to connect to the standalone Felix as a remote debugger
  • Embed Felix into Eclipse
  • Debug bundles with an embedded Felix

Productivity tools

Using development tools speeds up the development cycle and reduces issues due to manual intervention in the build process. They ensure that the correct dependencies are available, the bundling contains the right descriptors, and that the bundles are deployed to the expected target with the expected name. The build process becomes a simple exercise that's automated by the selected tools.

The first two tools that a serious developer should invest time in selecting are a good IDE and a build management system.

An Integrated Development Environment

An IDE is a software application that provides developers with a set of integrated components that assist in the development activity. An IDE will provide source code and resource editors frequently with contextual assistance on parts of the content and integration with a build management system. Many also provide integration with source code management and issue tracking systems.

There are many good IDEs for free! Take a look at the following:

Or you can just Google 'Java IDE' for a wide selection of choices for IDEs and build management systems.

For this project, I've picked Eclipse as my IDE. Eclipse is an extensible application framework (OSGi-based) with a rich feature-set and plugins. If you're interested, visit the Eclipse website for more information (http://www.eclipse.org/).

A build management system

Build management systems assist in the build side of things, they help in automating many of the repetitive tasks involved such as from the compilation of source code to the deployment of the end result to a common location.

The main outcome of this automation is the ability to develop components following a continuous integration strategy, whereby the different components of a system are unit tested and integration tested as they are developed. In those setups, a close eye must be kept on the automated integration and testing units.

One well-known build system is Apache Ant (http://ant.apache.org/), which allows the description of the sequence of tasks to be performed to build a system in one or more xml files; they act as build scripts.

I've picked Maven as the dependency management and build system (http://maven.apache.org). In addition to allowing automation of the build, packaging, and deployment of bundles with little configuration, it structures the build process in lifecycles and can be extended with a rich selection of plugins (Maven is described in greater detail in Chapter 2,Setting up the Environment).

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.222.114.28