Skip to content

yang-maven-pugin based on JNC( Java NETCONF Client, https://github.com/tail-f-systems/JNC ) and onos-yang-tools ,and a plugin for antlr4 to generate Java classes from YANG models

License

Notifications You must be signed in to change notification settings

airlenet/yang-java

 
 

Repository files navigation

yang-java

Yang file is parsed by Java antlr4; Yang file is parsed by java code and JNC code is generated. Its principle is based on JNC and onos-yang-tools

Reference JNC pyang antlr onos-yang-tools

yang-jnc

Modify based on JNC

yang-maven-plugin

Download

Download the latest JAR or grab via Maven:

<dependency>
  <groupId>com.airlenet.yang</groupId>
  <artifactId>yang-maven-plugin</artifactId>
  <version>LATEST</version>
</dependency>

Snapshots of the development version are available in Sonatype's snapshots repository.

Usage

<plugins>
    <plugin>
        <groupId>com.airlenet.yang</groupId>
        <artifactId>yang-maven-plugin</artifactId>
        <version>2.0.0-SNAPSHOT</version>
        <configuration>
            <yangFilesDir>src/main/yang</yangFilesDir>
            <packageName>com.test.yang.model.gen</packageName>
            <classFileDir>src/main/java</classFileDir>
        </configuration>
        <executions>
            <execution>
                <id>default</id>
                <goals>
                    <goal>yang2java</goal>
                </goals>
            </execution>
        </executions>
    </plugin>
    <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <version>1.7</version>
        <executions>
            <execution>
                <id>add-source</id>
                <phase>generate-sources</phase>
                <goals>
                    <goal>add-source</goal>
                </goals>
                <configuration>
                    <sources>
                        <source>target/generated-sources/java</source>
                    </sources>
                </configuration>
            </execution>
            <execution>
                <id>add-resource</id>
                <phase>generate-resources</phase>
                <goals>
                    <goal>add-resource</goal>
                </goals>
                <configuration>
                    <resources>
                        <resource>
                            <directory>target/generated-sources/java</directory>
                        </resource>
                    </resources>
                </configuration>
            </execution>
        </executions>
    </plugin>
</plugins>
mvn package                 # generator java class from yang model,compile,package

yang-example

License

See License File.

About

yang-maven-pugin based on JNC( Java NETCONF Client, https://github.com/tail-f-systems/JNC ) and onos-yang-tools ,and a plugin for antlr4 to generate Java classes from YANG models

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 95.3%
  • Python 2.8%
  • ANTLR 1.9%