Haitham
Haitham

Reputation: 89

How to add built in features in an ODL developed application?

For creating an ODL application, I have already built the application skeleton using maven as follows:

mvn archetype:generate -DarchetypeGroupId= org.opendaylight.controller -DarchetypeArtifactId=opendaylight-startup-archetype -DarchetypeRepository=http://nexus.opendaylight.org/content/repositories/opendaylight.release/ -DarchetypeCatalog=remote -DarchetypeVersion=1.3.0-Carbon

I am Confused which version I should be using in my "DarchetypeVersion=1.3.0-Carbon"? Where can I find all available versions to be used?

I am planning to uses some features that are not existing by default, I understand that any additional feature, as l2switching or openflowplugin, is added by editing the feature.xml and the pom.xml files. I am still confused about using different versions. How to specify versions in my pox.xml file?

I am editing the feature.xml file by adding more repository lines as follows:

< repository > mvn:org.opendaylight.yangtools/features-yangtools/{{VERSION}}/xml/features < /repository >
< repository > mvn:org.opendaylight.controller/features-mdsal/{{VERSION}}/xml/features < /repository>
< repository > mvn:org.opendaylight.mdsal.model/features-mdsal-model/{{VERSION}}/xml/features < /repository >
< repository > mvn:org.opendaylight.netconf/features-restconf/{{VERSION}}/xml/features < /repository >
< repository > mvn:org.opendaylight.dluxapps/features-dluxapps/{{VERSION}}/xml/features < /repository >
< repository > mvn:org.opendaylight.openflowplugin/features-openflowplugin/{{VERSION}}/xml/features < /repository >
< repository > mvn:org.opendaylight.l2switch/features-l2switch/{{VERSION}}/xml/features < /repository >

In the pom.xml file, looks like I need to add some dependency tags, but I am still confused what version to USE:

<dependency >
    < groupId > org.opendaylight.l2switch < /groupId >
    < artifactId > features-l2switch< /artifactId >
    < classifier >features < /classifier >
    < type > xml < /type >
    < version > ${l2switch.version} < /version >
    < scope > runtime < /scope >
< /dependency >

Upvotes: 0

Views: 502

Answers (1)

vorburger
vorburger

Reputation: 3938

E.g. https://stackoverflow.com/a/47069510/421602 lists the version numbers you can use for the opendaylight-startup-archetype. You can indeed also just check the repository, but the correct link to see all versions of that archetype would be https://nexus.opendaylight.org/#nexus-search;quick~opendaylight-startup-archetype (not yangtools-artifacts).

As for confusion re. versions in feature.xml and the pom.xml files, the best is to either look at the archetype example projects, or find the right version by looking at the appropriate branch in the OpenDaylight source code. For example, if you wanted to know what the correction version of say l2switch for ODL's Carbon release was, you could have a look at e.g. https://github.com/opendaylight/l2switch/blob/stable/carbon/artifacts/pom.xml to find 0.5.3-SNAPSHOT (or use 0.5.2).

FYI: As far as I know the archetype for the Nitrogen release is broken at the time of writing this; so I would just use the latest bleeding edge Oxygen, for the archetype and projects like l2switch or whatever you are interested in.

Upvotes: 0

Related Questions