LostInTheFrequencyDomain
LostInTheFrequencyDomain

Reputation: 1147

OpenDaylight Nitrogen: where to specify repository for features?

Where do I specify repository paths in OpenDaylight Nitrogen (on Karaf 4.0)? I am building a Java application on this platform. I noticed that features.xml is generated from the POM. I need to load some features from my local Maven .m2/repository that are generated from another project. I see a features/features-X directory with a pom.xml where I can add the feature dependency, but where do I specify the repository in which to look for the feature?

This is probably more of a Maven question than an OpenDaylight question....

Upvotes: 1

Views: 109

Answers (2)

Stephen Kitt
Stephen Kitt

Reputation: 2881

This is somewhat OpenDaylight-specific (although obviously the behaviour can be replicated using Maven in other contexts). As you’ve discovered, Karaf feature descriptors are now generated automatically, based on the POM dependencies. For this to work, the following requirements must be met:

  • the feature-generating module must have org.opendaylight.odlparent:single-feature-parent as its parent (transitively if necessary);
  • the POM must specify feature as its packaging type;
  • feature dependencies should be declared as build dependencies in the POM, using the default scope, with type set to xml and classifier set to features (plural).

If necessary, feature snippets can be given as src/main/feature/feature.xml (singular) in the corresponding module; these will be merged with the generated feature.xml (singular again). The result is installed as a features.xml (plural) file in the target repository.

It’s worth noting that feature descriptors generated in this fashion use each feature they depend upon as their own repositories; if you need a multi-feature repository instead, you should use a manually-generated feature descriptor.

This is briefly documented in the ODL Parent developer guide.

Upvotes: 3

LostInTheFrequencyDomain
LostInTheFrequencyDomain

Reputation: 1147

Just put it in as a dependency in features/features-X/pom.xml the plugin looks at the maven path and automatically generates the repository. ( Answering my own question so it could be of use to others. )

Upvotes: 1

Related Questions