Adding pom files for P4Runtime and GRPC

Change-Id: I9e205fc054875813200fe83a0bca4a9152ec66ae
diff --git a/protocols/p4runtime/proto/pom.xml b/protocols/p4runtime/proto/pom.xml
new file mode 100644
index 0000000..7e16bad
--- /dev/null
+++ b/protocols/p4runtime/proto/pom.xml
@@ -0,0 +1,193 @@
+<?xml version="1.0"?>
+<!--
+  ~ Copyright 2015-present Open Networking Foundation
+  ~
+  ~ Licensed under the Apache License, Version 2.0 (the "License");
+  ~ you may not use this file except in compliance with the License.
+  ~ You may obtain a copy of the License at
+  ~
+  ~     http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distributed under the License is distributed on an "AS IS" BASIS,
+  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~ See the License for the specific language governing permissions and
+  ~ limitations under the License.
+  -->
+<project
+    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
+    xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.onosproject</groupId>
+        <artifactId>onos-protocols-p4runtime</artifactId>
+        <version>1.12.0-SNAPSHOT</version>
+    </parent>
+    <artifactId>onos-protocols-p4runtime-proto</artifactId>
+    <packaging>bundle</packaging>
+
+    <description>ONOS P4Runtime Proto</description>
+
+    <properties>
+        <os.detected.classifier>linux-x86_64</os.detected.classifier>
+        <protobuf.version>3.0.2</protobuf.version>
+        <piCommit>a8814a8ac40838a9df83fe47a17a025b69026fcf</piCommit>
+        <piBaseUrl>https://github.com/p4lang/PI.git</piBaseUrl>
+    </properties>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.onosproject</groupId>
+            <artifactId>onos-protocols-p4runtime-api</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.onosproject</groupId>
+            <artifactId>onos-incubator-grpc</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>io.grpc</groupId>
+            <artifactId>grpc-core</artifactId>
+            <version>${grpccore.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>com.google.protobuf</groupId>
+            <artifactId>protobuf-java</artifactId>
+            <version>${protobuf.version}</version>
+        </dependency>
+
+    </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>exec-maven-plugin</artifactId>
+                <version>1.1.1</version>
+                <executions>
+                    <execution>
+                        <id>clone pi</id>
+                        <goals>
+                            <goal>exec</goal>
+                        </goals>
+                        <phase>initialize</phase>
+                        <configuration>
+                            <workingDirectory>target</workingDirectory>
+                            <executable>git</executable>
+                            <arguments>
+                                <argument>clone</argument>
+                                <!--<argument>&#45;&#45;quiet</argument>-->
+                                <argument>${piBaseUrl}</argument>
+                            </arguments>
+                        </configuration>
+                    </execution>
+                    <execution>
+                        <id>checkout pi</id>
+                        <goals>
+                            <goal>exec</goal>
+                        </goals>
+                        <phase>initialize</phase>
+                        <configuration>
+                            <workingDirectory>target/PI</workingDirectory>
+                            <executable>git</executable>
+                            <arguments>
+                                <argument>checkout</argument>
+                                <!--<argument>&#45;&#45;quiet</argument>-->
+                                <argument>-b</argument>
+                                <argument>buck-build</argument>
+                                <argument>${piCommit}</argument>
+                            </arguments>
+                        </configuration>
+                    </execution>
+                    <execution>
+                        <id>submodule pi</id>
+                        <goals>
+                            <goal>exec</goal>
+                        </goals>
+                        <phase>initialize</phase>
+                        <configuration>
+                            <workingDirectory>target/PI</workingDirectory>
+                            <executable>git</executable>
+                            <arguments>
+                                <argument>submodule</argument>
+                                <argument>update</argument>
+                                <!--<argument>&#45;&#45;quiet</argument>-->
+                                <argument>--init</argument>
+                                <argument>--recursive</argument>
+                            </arguments>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>org.xolstice.maven.plugins</groupId>
+                <artifactId>protobuf-maven-plugin</artifactId>
+                <version>0.5.0</version>
+                <configuration>
+                    <protocArtifact>com.google.protobuf:protoc:${protobuf.version}:exe:${os.detected.classifier}</protocArtifact>
+                    <pluginId>grpc</pluginId>
+                    <pluginArtifact>io.grpc:protoc-gen-grpc-java:${grpccore.version}:exe:${os.detected.classifier}</pluginArtifact>
+                </configuration>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>compile</goal>
+                            <goal>compile-custom</goal>
+                        </goals>
+                        <phase>generate-sources</phase>
+                        <configuration>
+                            <protoSourceRoot>${project.basedir}/target/PI/proto</protoSourceRoot>
+                            <includes>
+                                <include>p4/**/*.proto</include>
+                                <include>google/rpc/*.proto</include>
+                            </includes>
+                            <excludes>
+                                <exclude>openconfig/**/*.proto</exclude>
+                            </excludes>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>build-helper-maven-plugin</artifactId>
+                <version>3.0.0</version>
+                <executions>
+                    <execution>
+                        <id>add-source</id>
+                        <phase>generate-sources</phase>
+                        <goals>
+                            <goal>add-source</goal>
+                        </goals>
+                        <configuration>
+                            <sources combine.children="append">
+                                <source>${project.build.directory}/generated-sources/protobuf/grpc-java</source>
+                            </sources>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+            <!--<plugin>-->
+                <!--<groupId>com.googlecode.maven-download-plugin</groupId>-->
+                <!--<artifactId>download-maven-plugin</artifactId>-->
+                <!--<version>1.3.0</version>-->
+                <!--<executions>-->
+                    <!--<execution>-->
+                        <!--<id>install-any</id>-->
+                        <!--<phase>generate-resources</phase>-->
+                        <!--<goals>-->
+                            <!--<goal>wget</goal>-->
+                        <!--</goals>-->
+                        <!--<configuration>-->
+                            <!--<url>https://raw.githubusercontent.com/google/protobuf/master/src/google/protobuf/any.proto</url>-->
+                            <!--<outputDirectory>${project.basedir}/target/PI/proto/googleapis/google/protobuf</outputDirectory>-->
+                        <!--</configuration>-->
+                    <!--</execution>-->
+                <!--</executions>-->
+            <!--</plugin>-->
+
+        </plugins>
+    </build>
+
+</project>