Ask Your Question
0

How do I figure out the required pom.xml dependencies for YANG imports?

asked 2015-08-06 10:59:43 -0700

arthurc gravatar image

I have a YANG file that is attempting to import

  • opendaylight-l2-types
  • opendaylight-meter-types
  • opendaylight-flow-types
  • opendaylight-inventory

I've managed (through searching and fiddling) to get one of these to be happy by adding:

<dependency>
  <groupId>org.opendaylight.yangtools.model</groupId>
  <artifactId>opendaylight-l2-types</artifactId>
</dependency>

To my pom.xml file. However, I'm still having issues getting the other dependencies to resolve. Can someone please explain how to figure out the correlation between the YANG import and what magic has to go into the pom.xml file? I can't seem to find a clear example to get this dependency hell figured out. This whole Maven build mechanics is convoluted for the uninitiated I must say.

Thanks for any clues offered.

/a

I'm using the Lithium release version.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2015-08-06 11:03:04 -0700

updated 2015-08-06 17:37:46 -0700

Hello,

You can check the available models here.

To use a yang file (model) contained in Bundle 1 from a yang file contained in Bundle 2, you need to do 3 things:

  1. Take the groupId, artifactId and version of Bundle 1 and include it as a dependency in Bundle 2, like so:

    <dependency>
      <groupId>org.myorg.devproject</groupId>
      <artifactId>devartifact</artifactId>
      <version>6.6.6</version>
    </dependency>
    
  2. In your Bundle 2 yang file, include the yang file from Bundle 1 like this:

    import MODULE_NAME { prefix SOMETHING; revision-date "REVISION";}
    
  3. You can then access any typedefs, groupings or anything else by using the Bundle 1 yang prefix like this:

    uses SOMETHING:somegrouping;
    

Concrete example (I know it is yangtools, but it's applicable for any other projects):

Here is step 1 described above.

Note: In this example, the version isn't used because the parent has it in its dependencyManagement, but you will likely have to specify the version.

Here is step 2 described above.

Here is step 3 described above.

Hope it help shift your understanding of how "models" work. As I understand, you are trying to find "documented" models, but some of them will not be, that's why you have to look into the yang files.

edit flag offensive delete publish link more

Comments

Those list models provided by YANGTools but not models provided by other ODL projects. This is where I evidently figured out the magic to deal with the opendaylight-l2-types reference. Doesn't help me for the inventory nor openflow-related ones. A similar table for other projects would help.

arthurc ( 2015-08-06 14:23:04 -0700 )edit

Well, in that case, you have to check the "other ODL projects" in the yang files. I like github because of the search functionality.

grmontpetit ( 2015-08-06 15:24:15 -0700 )edit

No doubt as a search for "Available Models" in the ODL Wiki does return some other projects. The ones of interest here have URLs that point into a Jenkins build that don't exist. Even with those working, it's not clear how that would tell me what to type into my pom.xml file. Still no love.

arthurc ( 2015-08-06 15:37:42 -0700 )edit

Ok, let me re-explain in the main Answer.

grmontpetit ( 2015-08-06 17:15:30 -0700 )edit

Managed to get the model-inventory working by adding a version. However, other don't have a version entry and still work. I suspect that rather than sprinkling versions all through the pom.xml file, there's a more clever way by modifying the one in the features top directory.

arthurc ( 2015-08-07 08:07:37 -0700 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

[hide preview]

Question Tools

Follow
2 followers

Stats

Asked: 2015-08-06 10:59:43 -0700

Seen: 429 times

Last updated: Aug 06 '15