HIGUCHI Yuta
Committed by Yuta HIGUCHI

[ONOS-4520] Separate ProtoBuf model from gRPC services

Change-Id: Ib1e1358b1fd49206cfd15ffbba3b1448376d1702
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
36 <module>core</module> 36 <module>core</module>
37 <module>net</module> 37 <module>net</module>
38 <module>store</module> 38 <module>store</module>
39 + <module>protobuf</module>
39 <module>rpc</module> 40 <module>rpc</module>
40 <module>rpc-grpc</module> 41 <module>rpc-grpc</module>
41 </modules> 42 </modules>
......
1 +<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2 +<!--
3 + ~ Copyright 2016-present Open Networking Laboratory
4 + ~
5 + ~ Licensed under the Apache License, Version 2.0 (the "License");
6 + ~ you may not use this file except in compliance with the License.
7 + ~ You may obtain a copy of the License at
8 + ~
9 + ~ http://www.apache.org/licenses/LICENSE-2.0
10 + ~
11 + ~ Unless required by applicable law or agreed to in writing, software
12 + ~ distributed under the License is distributed on an "AS IS" BASIS,
13 + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 + ~ See the License for the specific language governing permissions and
15 + ~ limitations under the License.
16 + -->
17 +<features xmlns="http://karaf.apache.org/xmlns/features/v1.2.1" name="${project.artifactId}-${project.version}">
18 + <feature name="${project.artifactId}" version="${project.version}"
19 + description="${project.description}">
20 + <feature>onos-api</feature>
21 + <bundle>mvn:com.google.protobuf/protobuf-java/3.0.0-beta-2</bundle>
22 + <bundle>mvn:${project.groupId}/${project.artifactId}/${project.version}</bundle>
23 + </feature>
24 +</features>
1 +<?xml version="1.0" encoding="UTF-8"?>
2 +<!--
3 + ~ Copyright 2016-present Open Networking Laboratory
4 + ~
5 + ~ Licensed under the Apache License, Version 2.0 (the "License");
6 + ~ you may not use this file except in compliance with the License.
7 + ~ You may obtain a copy of the License at
8 + ~
9 + ~ http://www.apache.org/licenses/LICENSE-2.0
10 + ~
11 + ~ Unless required by applicable law or agreed to in writing, software
12 + ~ distributed under the License is distributed on an "AS IS" BASIS,
13 + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 + ~ See the License for the specific language governing permissions and
15 + ~ limitations under the License.
16 + -->
17 +<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">
18 + <modelVersion>4.0.0</modelVersion>
19 + <parent>
20 + <artifactId>onos-incubator</artifactId>
21 + <groupId>org.onosproject</groupId>
22 + <version>1.6.0-SNAPSHOT</version>
23 + </parent>
24 +
25 + <artifactId>onos-incubator-protobuf</artifactId>
26 + <packaging>bundle</packaging>
27 +
28 + <description>ONOS ProtoBuf models</description>
29 + <url>http://onosproject.org</url>
30 +
31 + <properties>
32 + <onos.app.name>org.onosproject.incubator.protobuf</onos.app.name>
33 + <onos.app.requires>org.onosproject.incubator.rpc</onos.app.requires>
34 + <!-- Note: update feature.xml when updating -->
35 + <protobuf.version>3.0.0-beta-2</protobuf.version>
36 + </properties>
37 +
38 + <dependencies>
39 +
40 + <dependency>
41 + <groupId>com.google.protobuf</groupId>
42 + <artifactId>protobuf-java</artifactId>
43 + <version>${protobuf.version}</version>
44 + </dependency>
45 +
46 + <dependency>
47 + <groupId>org.apache.felix</groupId>
48 + <artifactId>org.apache.felix.scr.annotations</artifactId>
49 + <scope>provided</scope>
50 + </dependency>
51 +
52 + </dependencies>
53 +
54 + <build>
55 + <extensions>
56 + <extension>
57 + <groupId>kr.motd.maven</groupId>
58 + <artifactId>os-maven-plugin</artifactId>
59 + <version>1.4.1.Final</version>
60 + </extension>
61 + </extensions>
62 +
63 + <pluginManagement>
64 + <plugins>
65 + <plugin>
66 + <groupId>org.apache.karaf.tooling</groupId>
67 + <artifactId>karaf-maven-plugin</artifactId>
68 + <version>3.0.5</version>
69 + <extensions>true</extensions>
70 + </plugin>
71 + </plugins>
72 + </pluginManagement>
73 +
74 + <plugins>
75 + <!-- TODO This is included to suppress the generation of javadocs for
76 + this package. There is a problem when we try to package the
77 + auto-generated code's javadoc into a jar. -->
78 + <plugin>
79 + <groupId>org.apache.maven.plugins</groupId>
80 + <artifactId>maven-javadoc-plugin</artifactId>
81 + <configuration>
82 + <sourcepath>${basedir}/src/main/java/</sourcepath>
83 + <excludePackageNames>org.onosproject.incubator.rpc.grpc</excludePackageNames>
84 + </configuration>
85 + </plugin>
86 +
87 + <plugin>
88 + <groupId>org.apache.felix</groupId>
89 + <artifactId>maven-bundle-plugin</artifactId>
90 + <extensions>true</extensions>
91 + </plugin>
92 +
93 + <plugin>
94 + <groupId>org.apache.maven.plugins</groupId>
95 + <artifactId>maven-compiler-plugin</artifactId>
96 + </plugin>
97 +
98 + <plugin>
99 + <groupId>org.apache.felix</groupId>
100 + <artifactId>maven-scr-plugin</artifactId>
101 + <executions>
102 + <execution>
103 + <id>generate-scr-srcdescriptor</id>
104 + <goals>
105 + <goal>scr</goal>
106 + </goals>
107 + </execution>
108 + </executions>
109 + <configuration>
110 + <!-- avoid searching into wrong source path -->
111 + <scanClasses>true</scanClasses>
112 + <supportedProjectTypes>
113 + <supportedProjectType>bundle</supportedProjectType>
114 + </supportedProjectTypes>
115 + </configuration>
116 + </plugin>
117 +
118 + <plugin>
119 + <groupId>org.xolstice.maven.plugins</groupId>
120 + <artifactId>protobuf-maven-plugin</artifactId>
121 + <version>0.5.0</version>
122 + <configuration>
123 + <!-- The version of protoc must match protobuf-java. If you don't
124 + depend on protobuf-java directly, you will be transitively depending on the
125 + protobuf-java version that grpc depends on. -->
126 + <protocArtifact>com.google.protobuf:protoc:${protobuf.version}:exe:${os.detected.classifier}</protocArtifact>
127 + <checkStaleness>true</checkStaleness>
128 + </configuration>
129 + <executions>
130 + <execution>
131 + <goals>
132 + <goal>compile</goal>
133 + </goals>
134 + </execution>
135 + </executions>
136 + </plugin>
137 +
138 + <plugin>
139 + <groupId>org.codehaus.mojo</groupId>
140 + <artifactId>build-helper-maven-plugin</artifactId>
141 + <version>1.10</version>
142 + <executions>
143 + <execution>
144 + <id>add-source</id>
145 + <phase>generate-sources</phase>
146 + <goals>
147 + <goal>add-source</goal>
148 + </goals>
149 + <configuration>
150 + <sources>
151 + <source>${project.build.directory}/generated-sources/protobuf/java</source>
152 + <source>${project.build.directory}/generated-sources/protobuf/grpc-java</source>
153 + </sources>
154 + </configuration>
155 + </execution>
156 + </executions>
157 + </plugin>
158 + </plugins>
159 + </build>
160 +
161 +</project>
...@@ -30,7 +30,8 @@ ...@@ -30,7 +30,8 @@
30 30
31 <properties> 31 <properties>
32 <onos.app.name>org.onosproject.incubator.rpc.grpc</onos.app.name> 32 <onos.app.name>org.onosproject.incubator.rpc.grpc</onos.app.name>
33 - <onos.app.requires>org.onosproject.incubator.rpc</onos.app.requires> 33 + <onos.app.requires>org.onosproject.incubator.rpc,org.onosproject.incubator.protobuf</onos.app.requires>
34 + <protobuf.version>3.0.0-beta-2</protobuf.version>
34 <!-- Note: update feature.xml when updating --> 35 <!-- Note: update feature.xml when updating -->
35 <grpc.version>0.14.0</grpc.version> 36 <grpc.version>0.14.0</grpc.version>
36 <grpc.netty.version>4.1.0.CR7</grpc.netty.version> 37 <grpc.netty.version>4.1.0.CR7</grpc.netty.version>
...@@ -51,13 +52,7 @@ ...@@ -51,13 +52,7 @@
51 <groupId>org.onosproject</groupId> 52 <groupId>org.onosproject</groupId>
52 <artifactId>onlab-osgi</artifactId> 53 <artifactId>onlab-osgi</artifactId>
53 </dependency> 54 </dependency>
54 -<!-- 55 +
55 - <dependency>
56 - <groupId>io.grpc</groupId>
57 - <artifactId>grpc-all</artifactId>
58 - <version>${grpc.version}</version>
59 - </dependency>
60 --->
61 <dependency> 56 <dependency>
62 <groupId>io.grpc</groupId> 57 <groupId>io.grpc</groupId>
63 <artifactId>grpc-core</artifactId> 58 <artifactId>grpc-core</artifactId>
...@@ -98,10 +93,17 @@ ...@@ -98,10 +93,17 @@
98 </dependency> 93 </dependency>
99 94
100 <dependency> 95 <dependency>
96 + <groupId>org.onosproject</groupId>
97 + <artifactId>onos-incubator-protobuf</artifactId>
98 + <version>${project.version}</version>
99 + </dependency>
100 +
101 + <dependency>
101 <groupId>org.apache.felix</groupId> 102 <groupId>org.apache.felix</groupId>
102 <artifactId>org.apache.felix.scr.annotations</artifactId> 103 <artifactId>org.apache.felix.scr.annotations</artifactId>
103 <scope>provided</scope> 104 <scope>provided</scope>
104 </dependency> 105 </dependency>
106 +
105 </dependencies> 107 </dependencies>
106 108
107 <build> 109 <build>
...@@ -206,7 +208,7 @@ ...@@ -206,7 +208,7 @@
206 <!-- The version of protoc must match protobuf-java. If you don't 208 <!-- The version of protoc must match protobuf-java. If you don't
207 depend on protobuf-java directly, you will be transitively depending on the 209 depend on protobuf-java directly, you will be transitively depending on the
208 protobuf-java version that grpc depends on. --> 210 protobuf-java version that grpc depends on. -->
209 - <protocArtifact>com.google.protobuf:protoc:3.0.0-beta-2:exe:${os.detected.classifier}</protocArtifact> 211 + <protocArtifact>com.google.protobuf:protoc:${protobuf.version}:exe:${os.detected.classifier}</protocArtifact>
210 <pluginId>grpc-java</pluginId> 212 <pluginId>grpc-java</pluginId>
211 <pluginArtifact>io.grpc:protoc-gen-grpc-java:${grpc.version}:exe:${os.detected.classifier}</pluginArtifact> 213 <pluginArtifact>io.grpc:protoc-gen-grpc-java:${grpc.version}:exe:${os.detected.classifier}</pluginArtifact>
212 <checkStaleness>true</checkStaleness> 214 <checkStaleness>true</checkStaleness>
......