Skip to content

Instantly share code, notes, and snippets.

@amirmv2006
Created September 21, 2021 16:30
Show Gist options
  • Save amirmv2006/d3201177d698465df50fb593f0be9699 to your computer and use it in GitHub Desktop.
Save amirmv2006/d3201177d698465df50fb593f0be9699 to your computer and use it in GitHub Desktop.
put Generated annotation on generated code!
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>anonotate-proto</id>
<phase>generate-sources</phase>
<configuration>
<target>
<replaceregexp match="public(.*) class" flags="g" replace="@javax.annotation.Generated(&quot;protoc&quot;) \0">
<fileset dir="${project.basedir}/src/main/generated" includes="**/*.java" />
</replaceregexp>
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment