HBASE-18667 Add @Generated to protobuf classes
authorMike Drob <mdrob@apache.org>
Wed, 11 Oct 2017 19:21:03 +0000 (14:21 -0500)
committerMike Drob <mdrob@apache.org>
Thu, 12 Oct 2017 17:08:22 +0000 (12:08 -0500)
hbase-protocol-shaded/pom.xml
hbase-protocol/pom.xml

index fa66a83..4f52bba 100644 (file)
                 <token>([^\.])com.google.protobuf</token> 
                 <value>$1org.apache.hadoop.hbase.shaded.com.google.protobuf</value> 
               </replacement>
+              <replacement>
+                <token>(public)(\W+static)?(\W+final)?(\W+class)</token>
+                <value>@javax.annotation.Generated("proto") $1$2$3$4</value>
+              </replacement>
+              <!-- replacer doesn't support anchoring or negative lookbehind -->
+              <replacement>
+                <token>(@javax.annotation.Generated\("proto"\) ){2}</token>
+                <value>$1</value>
+              </replacement>
             </replacements>
         </configuration> 
       </plugin>
index 0980d45..f5ff08e 100644 (file)
           </execution>
         </executions>
       </plugin>
+      <plugin>
+        <groupId>com.google.code.maven-replacer-plugin</groupId>
+        <artifactId>replacer</artifactId>
+        <version>1.5.3</version>
+        <executions>
+          <execution>
+            <phase>generate-sources</phase>
+            <goals>
+              <goal>replace</goal>
+            </goals>
+          </execution>
+        </executions>
+        <configuration>
+          <basedir>${basedir}/target/generated-sources/</basedir>
+            <includes>
+                <include>**/*.java</include>
+            </includes>
+            <replacements>
+              <replacement>
+                <token>(public)(\W+static)?(\W+final)?(\W+class)</token>
+                <value>@javax.annotation.Generated("proto") $1$2$3$4</value>
+              </replacement>
+              <!-- replacer doesn't support anchoring or negative lookbehind -->
+              <replacement>
+                <token>(@javax.annotation.Generated\("proto"\) ){2}</token>
+                <value>$1</value>
+              </replacement>
+            </replacements>
+        </configuration>
+      </plugin>
     </plugins>
     <pluginManagement>
       <plugins>