Added Maven plugin for generation SAL APIs from YANG
[controller.git] / opendaylight / sal / yang-prototype / code-generator / samples / maven-code-gen-sample / pom.xml
diff --git a/opendaylight/sal/yang-prototype/code-generator/samples/maven-code-gen-sample/pom.xml b/opendaylight/sal/yang-prototype/code-generator/samples/maven-code-gen-sample/pom.xml
new file mode 100644 (file)
index 0000000..5579719
--- /dev/null
@@ -0,0 +1,104 @@
+<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>
+        <artifactId>binding-generator</artifactId>
+        <groupId>org.opendaylight.controller</groupId>
+        <version>1.0</version>
+    </parent>
+    <artifactId>maven-code-gen-sample</artifactId>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.opendaylight.controller</groupId>
+                <artifactId>maven-yang-plugin</artifactId>
+                <version>1.0</version>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>generate-sources</goal>
+                        </goals>
+                        <configuration>
+                            <yangFilesRootDir>src/main/yang</yangFilesRootDir>
+                            <codeGenerators>
+                                <generator>
+                                    <codeGeneratorClass>
+                                        org.opendaylight.controller.maven.sal.api.gen.plugin.CodeGeneratorImpl
+                                    </codeGeneratorClass>
+                                    <outputBaseDir>
+                                        target/generated-sources/sal
+                                    </outputBaseDir>
+                                </generator>
+                            </codeGenerators>
+                        </configuration>
+                    </execution>
+                </executions>
+
+                <dependencies>
+                    <dependency>
+                        <groupId>org.opendaylight.controller</groupId>
+                        <artifactId>maven-sal-api-gen-plugin</artifactId>
+                        <version>1.0</version>
+                        <type>jar</type>
+                    </dependency>
+                </dependencies>
+            </plugin>
+            <plugin>
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>build-helper-maven-plugin</artifactId>
+                <version>1.7</version>
+                <executions>
+                    <execution>
+                        <phase>generate-sources</phase>
+                        <goals>
+                            <goal>add-source</goal>
+                        </goals>
+                        <configuration>
+                            <sources>
+                                <source>target/generated-sources/sal</source>
+                            </sources>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+        <pluginManagement>
+               <plugins>
+                       <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
+                       <plugin>
+                               <groupId>org.eclipse.m2e</groupId>
+                               <artifactId>lifecycle-mapping</artifactId>
+                               <version>1.0.0</version>
+                               <configuration>
+                                       <lifecycleMappingMetadata>
+                                               <pluginExecutions>
+                                                       <pluginExecution>
+                                                               <pluginExecutionFilter>
+                                                                       <groupId>
+                                                                               org.opendaylight.controller
+                                                                       </groupId>
+                                                                       <artifactId>
+                                                                               maven-yang-plugin
+                                                                       </artifactId>
+                                                                       <versionRange>
+                                                                               [1.0,)
+                                                                       </versionRange>
+                                                                       <goals>
+                                                                               <goal>
+                                                                                       generate-sources
+                                                                               </goal>
+                                                                       </goals>
+                                                               </pluginExecutionFilter>
+                                                               <action>
+                                                                       <ignore></ignore>
+                                                               </action>
+                                                       </pluginExecution>
+                                               </pluginExecutions>
+                                       </lifecycleMappingMetadata>
+                               </configuration>
+                       </plugin>
+               </plugins>
+        </pluginManagement>
+    </build>
+</project>
\ No newline at end of file