+++ /dev/null
-Use
-GROUP_ID=com.mycompany.app
-ARTIFACT_ID=my-app
-mvn archetype:generate -DgroupId=$GROUP_ID -DartifactId=$ARTIFACT_ID \
- -DarchetypeArtifactId=config-module-archetype -DarchetypeGroupId=org.opendaylight.controller \
- -DarchetypeVersion=0.2.5-SNAPSHOT
-
-Module name and prefix define yang module name and its java name prefix.
-For example when creating thread factory wrapper, yang name might be
-thread-factory
-and java prefix
-ThreadFactory
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.opendaylight.controller</groupId>
- <artifactId>config-subsystem</artifactId>
- <version>0.6.0-SNAPSHOT</version>
- </parent>
-
- <artifactId>config-module-archetype</artifactId>
- <name>config-module-archetype</name>
- <description>Archetype for new module managed by configuration subsystem</description>
-
-</project>
+++ /dev/null
-<archetype>
- <id>config-module-archetype</id>
-
- <allowPartial>true</allowPartial>
-
- <requiredProperties>
- <requiredProperty key="module-name">
- </requiredProperty>
- <requiredProperty key="module-name-java-prefix">
- </requiredProperty>
- <requiredProperty key="module-implementation-name">
- <defaultValue>impl</defaultValue>
- </requiredProperty>
- <requiredProperty key="config-api-yang-revision">
- <defaultValue>2013-04-05</defaultValue>
- </requiredProperty>
- <requiredProperty key="config-api-version">
- <defaultValue>0.2.5-SNAPSHOT</defaultValue>
- </requiredProperty>
- <requiredProperty key="yang-maven-plugin-version">
- <defaultValue>0.6.2-SNAPSHOT</defaultValue>
- </requiredProperty>
- <requiredProperty key="revision">
- <defaultValue>2014-01-31</defaultValue>
- </requiredProperty>
- <requiredProperty key="service-java-class">
- <defaultValue>java.lang.AutoCloseable</defaultValue>
- </requiredProperty>
- <requiredProperty key="maven-bundle-plugin-version">
- <defaultValue>2.4.0</defaultValue>
- </requiredProperty>
- <requiredProperty key="yang-namespace-mapping-from">
- <defaultValue>urn:opendaylight:params:xml:ns:yang:controller</defaultValue>
- </requiredProperty>
- <requiredProperty key="yang-namespace-mapping-to">
- <defaultValue>org.opendaylight.controller.config.yang</defaultValue>
- </requiredProperty>
-
- </requiredProperties>
-
- <fileSets>
- <fileSet filtered="true" encoding="UTF-8">
- <directory>src/main/yang</directory>
- </fileSet>
- </fileSets>
-</archetype>
+++ /dev/null
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
-
- <groupId>${groupId}</groupId>
- <artifactId>${artifactId}</artifactId>
- <version>${version}</version>
- <packaging>bundle</packaging>
-
- <properties>
- <config.version>${config-api-version}</config.version>
- <yangtools.version>${yang-maven-plugin-version}</yangtools.version>
- <mdsal.model.version>${mdsal-model-version}</mdsal.model.version>
- <maven.bundle.version>${maven-bundle-plugin-version}</maven.bundle.version>
- <java.version.source>1.7</java.version.source>
- <java.version.target>1.7</java.version.target>
- <maven.compile.plugin.version>2.5.1</maven.compile.plugin.version>
- </properties>
-
- <dependencies>
- <dependency>
- <groupId>org.opendaylight.controller</groupId>
- <artifactId>config-api</artifactId>
- <version>${config.version}</version>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.opendaylight.yangtools</groupId>
- <artifactId>yang-maven-plugin</artifactId>
- <version>${yangtools.version}</version>
- <executions>
- <execution>
- <id>config</id>
- <goals>
- <goal>generate-sources</goal>
- </goals>
- <configuration>
- <codeGenerators>
- <generator>
- <codeGeneratorClass>
- org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator
- </codeGeneratorClass>
- <outputBaseDir>${jmxGeneratorPath}</outputBaseDir>
- <additionalConfiguration>
- <namespaceToPackage1>
- ${yang-namespace-mapping-from}==${yang-namespace-mapping-to}
- </namespaceToPackage1>
- </additionalConfiguration>
- </generator>
- <generator>
- <codeGeneratorClass>
- org.opendaylight.yangtools.maven.sal.api.gen.plugin.CodeGeneratorImpl
- </codeGeneratorClass>
- <outputBaseDir>
- ${salGeneratorPath}
- </outputBaseDir>
- </generator>
- </codeGenerators>
- <inspectDependencies>true</inspectDependencies>
- </configuration>
- </execution>
- </executions>
- <dependencies>
- <dependency>
- <groupId>org.opendaylight.controller</groupId>
- <artifactId>yang-jmx-generator-plugin</artifactId>
- <version>${config.version}</version>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.mdsal</groupId>
- <artifactId>maven-sal-api-gen-plugin</artifactId>
- <version>${mdsal.model.version}</version>
- </dependency>
- </dependencies>
- </plugin>
-
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <extensions>true</extensions>
- <configuration>
- <instructions>
- <Bundle-Name>${project.groupId}.${project.artifactId}</Bundle-Name>
- </instructions>
- </configuration>
- </plugin>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <version>${maven.compile.plugin.version}</version>
- <configuration>
- <source>${java.version.source}</source>
- <target>${java.version.target}</target>
- <testSource>${java.version.source}</testSource>
- <testTarget>${java.version.target}</testTarget>
- </configuration>
- </plugin>
-
- </plugins>
- </build>
-</project>
+++ /dev/null
-module ${module-name}-${module-implementation-name} {
-
- yang-version 1;
- namespace "urn:opendaylight:params:xml:ns:yang:controller:config:${module-name}:${module-implementation-name}";
- prefix "${module-name}-${module-implementation-name}";
-
- import config { prefix config; revision-date ${config-api-yang-revision}; }
- import ${module-name} { prefix ${module-name}; revision-date ${revision}; }
-
- description
- "This module contains the base YANG definitions for
- ${module-name} ${module-implementation-name} implementation.";
-
- revision "${revision}" {
- description
- "Initial revision.";
- }
-
- // This is the definition of a service implementation
- identity ${module-name}-${module-implementation-name} {
- base config:module-type;
- config:provided-service ${module-name}:${module-name};
- config:java-name-prefix ${module-name-java-prefix};
- }
-
- augment "/config:modules/config:module/config:configuration" {
- case ${module-name}-${module-implementation-name} {
- when "/config:modules/config:module/config:type = '${module-name}-${module-implementation-name}'";
-
- leaf simple-attribute {
- type uint32;
- }
-
- container dto-attribute {
- leaf inner-attribute {
- type string;
- }
- }
-
- // Dependency attribute demonstration, the config:required-identity points to a service type
- // In this case it is the same service type as this implementation provides: ${module-name}
- container dependency-attribute {
- uses config:service-ref {
- refine type {
- mandatory false;
- config:required-identity ${module-name}:${module-name};
- }
- }
- }
-
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-module ${module-name} {
-
- yang-version 1;
- namespace "urn:opendaylight:params:xml:ns:yang:controller:config:${module-name}";
- prefix "${module-name}";
-
- import config { prefix config; revision-date ${config-api-yang-revision}; }
-
- description
- "This module contains the base YANG definitions for
- ${module-name} services.";
-
- revision "${revision}" {
- description
- "Initial revision.";
- }
-
- // This is the definition of a service
- identity ${module-name} {
-
- base "config:service-type";
-
- // TODO modify the java class
- config:java-class " ${service-java-class}";
- }
-}
\ No newline at end of file
<module>yang-test-plugin</module>
<module>shutdown-api</module>
<module>shutdown-impl</module>
- <module>config-module-archetype</module>
<module>config-netty-config</module>
<module>config-artifacts</module>
<module>config-parent</module>