1 ODL Parent Developer Guide
2 ==========================
10 The ODL Parent component for OpenDaylight provides a number of Maven
11 parent POMs which allow Maven projects to be easily integrated in the
12 OpenDaylight ecosystem. Technically, the aim of projects in OpenDaylight
13 is to produce Karaf features, and these parent projects provide common
14 support for the different types of projects involved.
16 These parent projects are:
18 - ``odlparent-lite`` — the basic parent POM for Maven modules which
19 don’t produce artifacts (*e.g.* aggregator POMs)
21 - ``odlparent`` — the common parent POM for Maven modules containing
24 - ``bundle-parent`` — the parent POM for Maven modules producing OSGi
27 - ``single-feature-parent`` — the parent POM for Maven modules producing
28 a single Karaf feature
30 - ``feature-repo-parent`` — the parent POM for Maven modules producing
33 - ``karaf4-parent`` — the parent POM for Maven modules producing Karaf 4
36 The following parent projects are deprecated:
38 - ``feature-parent`` — the parent POM for Maven modules producing
39 Karaf 3 feature repositories
41 - ``karaf-parent`` — the parent POM for Maven modules producing Karaf 3
47 This is the base parent for all OpenDaylight Maven projects and
48 modules. It provides the following, notably to allow publishing
49 artifacts to Maven Central:
51 - license information;
53 - organization information;
55 - issue management information (a link to our Bugzilla);
57 - continuous integration information (a link to our Jenkins setup);
59 - default Maven plugins (``maven-clean-plugin``,
60 ``maven-deploy-plugin``, ``maven-install-plugin``,
61 ``maven-javadoc-plugin`` with HelpMojo support,
62 ``maven-project-info-reports-plugin``, ``maven-site-plugin`` with
63 Asciidoc support, ``jdepend-maven-plugin``);
65 - distribution management information.
67 It also defines two profiles which help during development:
69 - ``q`` (``-Pq``), the quick profile, which disables tests, code
70 coverage, Javadoc generation, code analysis, etc. — anything which
71 isn’t necessary to build the bundles and features (see `this blog
72 post <http://blog2.vorburger.ch/2016/06/improve-maven-build-speed-with-q.html>`__
75 - ``addInstallRepositoryPath``
76 (``-DaddInstallRepositoryPath=…/karaf/system``) which can be used to
77 drop a bundle in the appropriate Karaf location, to enable
78 hot-reloading of bundles during development (see `this blog
79 post <http://blog2.vorburger.ch/2016/06/maven-install-into-additional.html>`__
82 For modules which don’t produce any useful artifacts (*e.g.* aggregator
83 POMs), you should add the following to avoid processing artifacts:
90 <groupId>org.apache.maven.plugins</groupId>
91 <artifactId>maven-deploy-plugin</artifactId>
97 <groupId>org.apache.maven.plugins</groupId>
98 <artifactId>maven-install-plugin</artifactId>
109 This inherits from ``odlparent-lite`` and mainly provides dependency and
110 plugin management for OpenDaylight projects.
112 If you use any of the following libraries, you should rely on
113 ``odlparent`` to provide the appropriate versions:
121 - ``commons-fileupload``
155 - core OSGi dependencies (``core``, ``compendium``\ …)
179 This list isn’t exhaustive. It’s also not cast in stone; if you’d
180 like to add a new dependency (or migrate a dependency), please
182 list <https://lists.opendaylight.org/mailman/listinfo/odlparent-dev>`__.
184 ``odlparent`` also enforces some Checkstyle verification rules. In
185 particular, it enforces the common license header used in all
191 * Copyright © ${year} ${holder} and others. All rights reserved.
193 * This program and the accompanying materials are made available under the
194 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
195 * and is available at http://www.eclipse.org/legal/epl-v10.html
198 where “\ ``${year}``\ ” is initially the first year of publication, then
199 (after a year has passed) the first and latest years of publication,
200 separated by commas (*e.g.* “2014, 2016”), and “\ ``${holder}``\ ” is
201 the initial copyright holder (typically, the first author’s employer).
202 “All rights reserved” is optional.
204 If you need to disable this license check, *e.g.* for files imported
205 under another license (EPL-compatible of course), you can override the
206 ``maven-checkstyle-plugin`` configuration. ``features-test`` does this
207 for its ``CustomBundleUrlStreamHandlerFactory`` class, which is
213 <artifactId>maven-checkstyle-plugin</artifactId>
216 <id>check-license</id>
220 <phase>process-sources</phase>
222 <configLocation>check-license.xml</configLocation>
223 <headerLocation>EPL-LICENSE.regexp.txt</headerLocation>
224 <includeResources>false</includeResources>
225 <includeTestResources>false</includeTestResources>
226 <sourceDirectory>${project.build.sourceDirectory}</sourceDirectory>
228 <!-- Skip Apache Licensed files -->
229 org/opendaylight/odlparent/featuretest/CustomBundleUrlStreamHandlerFactory.java
231 <failsOnError>false</failsOnError>
232 <consoleOutput>true</consoleOutput>
241 This inherits from ``odlparent`` and enables functionality useful for
244 - ``maven-javadoc-plugin`` is activated, to build the Javadoc JAR;
246 - ``maven-source-plugin`` is activated, to build the source JAR;
248 - ``maven-bundle-plugin`` is activated (including extensions), to build
249 OSGi bundles (using the “bundle” packaging).
251 In addition to this, JUnit is included as a default dependency in “test”
254 single-feature-parent
255 ~~~~~~~~~~~~~~~~~~~~~
257 This inherits from ``odlparent`` and enables functionality useful for
260 - ``karaf-maven-plugin`` is activated, to build Karaf features, typically
261 with “feature” packaging (“kar” is also supported);
263 - ``feature.xml`` files are generated based on the compile-scope dependencies
264 defined in the POM, optionally initialised from a stub in
265 ``src/main/feature/feature.xml``.
267 - Karaf features are tested after build to ensure they can be activated
268 in a Karaf container.
270 The ``feature.xml`` processing adds transitive dependencies by default, which
271 allows features to be defined using only the most significant dependencies
272 (those that define the feature); other requirements are determined
273 automatically as long as they exist as Maven dependencies.
275 “configfiles” need to be defined both as Maven dependencies (with the
276 appropriate type and classifier) and as ``<configfile>`` elements in the
277 ``feature.xml`` stub.
279 Other features which a feature depends on need to be defined as Maven
280 dependencies with type “xml” and classifier “features” (note the plural here).
285 This inherits from ``odlparent`` and enables functionality useful for
286 Karaf feature repositories. It follows the same principles as
287 ``single-feature-parent``, but is designed specifically for repositories
288 and should be used only for this type of artifacts.
290 It builds a feature repository referencing all the (feature) dependencies
296 This allows building a Karaf 4 distribution, typically for local testing
297 purposes. Any runtime-scoped feature dependencies will be included in the
298 distribution, and the ``karaf.localFeature`` property can be used to
299 specify the boot feature (in addition to ``standard``).
304 The ODL Parent component for OpenDaylight provides a number of Karaf
305 features which can be used by other Karaf features to use certain
306 third-party upstream dependencies.
310 - Akka features (in the ``features4-akka`` repository):
312 - ``odl4-akka-all`` — all Akka bundles;
314 - ``odl4-akka-scala-2.11`` — Scala runtime for OpenDaylight;
316 - ``odl4-akka-system-2.4`` — Akka actor framework bundles;
318 - ``odl4-akka-clustering-2.4`` — Akka clustering bundles and
321 - ``odl4-akka-leveldb-0.7`` — LevelDB;
323 - ``odl4-akka-persistence-2.4`` — Akka persistence;
325 - general third-party features (in the ``features4-odlparent``
328 - ``odl4-netty-4`` — all Netty bundles;
330 - ``odl4-guava-18`` — Guava 18;
332 - ``odl4-guava-21`` — Guava 21 (not indended for use in Carbon);
334 - ``odl4-lmax-3`` — LMAX Disruptor;
336 - ``odl4-triemap-0.2`` — Concurrent Trie HashMap;
338 - Karaf wrapper features (also in the ``features4-odlparent``
339 repository) — these can be used to pull in a Karaf feature
340 using a Maven dependency in a POM:
342 - ``odl-karaf-feat-feature`` — the Karaf ``feature`` feature;
344 - ``odl-karaf-feat-jdbc`` — the Karaf ``jdbc`` feature;
346 - ``odl-karaf-feat-jetty`` — the Karaf ``jetty`` feature;
348 - ``odl-karaf-feat-war`` — the Karaf ``war`` feature.
350 To use these, all you need to do now is add the appropriate dependency
351 in your feature POM; for example:
356 <groupId>org.opendaylight.odlparent</groupId>
357 <artifactId>odl4-guava-18</artifactId>
358 <classifier>features</classifier>
362 assuming the appropriate dependency management:
366 <dependencyManagement>
369 <groupId>org.opendaylight.odlparent</groupId>
370 <artifactId>odlparent-artifacts</artifactId>
371 <version>1.8.0-SNAPSHOT</version>
372 <scope>import</scope>
376 </dependencyManagement>
378 (the version number there is appropriate for Carbon).