Generating Java Code from YANG File using OpenDaylight yangtools

36 views Asked by At

I am working on a project where I need to generate Java code from a YANG file using the Open Daylight yang tools library. I came across the yang tools repository on GitHub (https://github.com/opendaylight/yangtools) but I am having trouble figuring out the steps to generate the Java code.

I would appreciate any guidance or examples on how to properly use yangtools for Java code generation from YANG files. Thank you!

I included the provided configuration inside my pom.xml file, compiled the project, but I'm not getting any output. Can anyone please guide me through the steps to generate the code? Additionally, I would appreciate it if someone could provide alternative source code for generating code from a YANG file.

  <plugin>
                <groupId>org.opendaylight.yangtools</groupId>
                <artifactId>maven-yang-plugin</artifactId>
                <version>13.0.2-SNAPSHOT</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>compile</goal>
                        </goals>
                        <configuration>
                            <yangFiles>
                                <directory>/home/tambora/confd-yangfiles</directory>
                            </yangFiles>
                            <outputBaseDir>/generated-sources/yang</outputBaseDir>
                            <packageName>your.generated.package</packageName>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
0

There are 0 answers