2.2. Development Model
Figure 2.1. Developing a JBoss Fuse Project
- Maven directory layout—Maven has a standard directory layout that determines where you put your Java code, associated resources, XML configuration files, unit test code, and so on.
- Accessing dependencies through the Internet—Maven has the ability to download dependencies automatically through the Internet, by searching through known Maven repositories. This implies that you must have access to the Internet, when building with Maven. See the section called “Maven repositories”.
Maven POM files
pom.xml, provides the description of how to build your project. The initial version of a POM is typically generated by a Maven archetype. You can then customise the POM as needed.
- Aggregator POM—a complete application is typically composed of multiple Maven projects, which must be built in a certain order. To simplify building multi-project applications, Maven enables you to define an aggregator POM, which can build all of the sub-projects in a single step. For more details, see Section 3.3, “Create an Aggregate Maven Project”.
- Parent POM—in a multi-project application, the POMs for the sub-projects typically contain a lot of the same information. Over the long term, maintaining this information, which is spread across multiple POM files, would time-consuming and error-prone. To make the POMs more manageable, you can define a parent POM, which encapsulates all of the shared information.
Java code and resources
src/main/java, for your Java code, and for the associated resource files,
src/main/resources. When Maven builds a JAR file, it automatically compiles all of the Java code and adds it to the JAR package. Likewise, all of the resource files found under
src/main/resourcesare copied into the JAR package.
Dependency injection frameworks
- The JAR manifest can be used to provide deployment metadata for an OSGi bundle (in bundle headers).
- The POM file is normally embedded in any Maven-built JAR file.
web.xmlfile is the standard descriptor for an application packaged as a Web ARchive (WAR).
- Apache Karaf features—a feature specifies a related collection of packages that can be deployed together. By selecting which features to install (or uninstall), an administrator can easily control which blocks of functionality are deployed in the container.
- OSGi Config Admin properties—the OSGi Config Admin service exposes configuration properties to the administrator at run time, making it easy to customize application behavior (for example, by customizing the TCP port numbers on a server).