Skip to content

Commit

Permalink
ISSUE apache#691: Move generated files into their own module
Browse files Browse the repository at this point in the history
Upcoming changes are using GRpc in conjunction with protobuf. GRpc
generates code that created deprecation warnings when compiled with
java 8, so this change moves all generated code out to another module,
so that we don't have to turn off -Werror for all code.

In any case, at some point we should split the bookkeeper client out
from the server module, at which point we would need the definitions
on a common place.

Author: Ivan Kelly <ivank@apache.org>

Reviewers: Enrico Olivelli <eolivelli@gmail.com>, Jia Zhai <None>, Sijie Guo <sijie@apache.org>

This closes apache#711 from ivankelly/proto-module, closes apache#691
  • Loading branch information
ivankelly authored and Philip Su committed Dec 8, 2017
1 parent 51a4d45 commit d5f715d
Show file tree
Hide file tree
Showing 5 changed files with 73 additions and 22 deletions.
69 changes: 69 additions & 0 deletions bookkeeper-proto/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
<?xml version="1.0"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You 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 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>bookkeeper</artifactId>
<groupId>org.apache.bookkeeper</groupId>
<version>4.6.0-SNAPSHOT</version>
</parent>
<artifactId>bookkeeper-proto</artifactId>
<name>Apache BookKeeper :: Protocols</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-java</artifactId>
<version>${protobuf.version}</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.rat</groupId>
<artifactId>apache-rat-plugin</artifactId>
<configuration>
<excludes>
<!-- exclude generated file //-->
<exclude>**/DataFormats.java</exclude>
<exclude>**/BookkeeperProtocol.java</exclude>
</excludes>
</configuration>
</plugin>
<plugin>
<groupId>org.xolstice.maven.plugins</groupId>
<artifactId>protobuf-maven-plugin</artifactId>
<version>0.5.0</version>
<configuration>
<protocArtifact>com.google.protobuf:protoc:3.4.0:exe:${os.detected.classifier}</protocArtifact>
<checkStaleness>true</checkStaleness>
</configuration>
<executions>
<execution>
<goals>
<goal>compile</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
25 changes: 3 additions & 22 deletions bookkeeper-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,9 @@
<version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-java</artifactId>
<version>${protobuf.version}</version>
<scope>compile</scope>
<groupId>org.apache.bookkeeper</groupId>
<artifactId>bookkeeper-proto</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
Expand Down Expand Up @@ -294,8 +293,6 @@
<configuration>
<excludes>
<!-- exclude generated file //-->
<exclude>**/DataFormats.java</exclude>
<exclude>**/BookkeeperProtocol.java</exclude>
<exclude>**/target/**/*</exclude>
<exclude>**/.classpath</exclude>
<exclude>**/.gitignore</exclude>
Expand Down Expand Up @@ -372,22 +369,6 @@
</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:3.4.0:exe:${os.detected.classifier}</protocArtifact>
<checkStaleness>true</checkStaleness>
</configuration>
<executions>
<execution>
<goals>
<goal>compile</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
Expand Down
1 change: 1 addition & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
</ciManagement>
<modules>
<module>buildtools</module>
<module>bookkeeper-proto</module>
<module>bookkeeper-common</module>
<module>bookkeeper-stats</module>
<module>bookkeeper-server</module>
Expand Down

0 comments on commit d5f715d

Please sign in to comment.