vinayakumarb commented on a change in pull request #1494: HADOOP-16558.
[COMMON+HDFS] use protobuf-maven-plugin to generate protobuf classes
URL: https://github.com/apache/hadoop/pull/1494#discussion_r326912969
##########
File path: hadoop-project/pom.xml
##########
@@ -1715,9 +1715,43 @@
<artifactId>frontend-maven-plugin</artifactId>
<version>${frontend-maven-plugin.version}</version>
</plugin>
+ <plugin>
+ <groupId>org.xolstice.maven.plugins</groupId>
+ <artifactId>protobuf-maven-plugin</artifactId>
+ <version>${protobuf-maven-plugin.version}</version>
+ <extensions>true</extensions>
+ <configuration>
+ <protocArtifact>
+
com.google.protobuf:protoc:${protobuf.version}:exe:${os.detected.classifier}
+ </protocArtifact>
+ <attachProtoSources>false</attachProtoSources>
+ </configuration>
+ <executions>
+ <execution>
+ <id>src-compile-protoc</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>compile</goal>
+ </goals>
+ <configuration>
+
<includeDependenciesInDescriptorSet>false</includeDependenciesInDescriptorSet>
+ <protoSourceRoot>${basedir}/src/main/proto</protoSourceRoot>
+
<outputDirectory>${project.build.directory}/generated-sources/java</outputDirectory>
+ <clearOutputDirectory>false</clearOutputDirectory>
+ <skip>true</skip>
Review comment:
> Do we need this? I suppose this is under the PluginMangement tag, so
unless we declare this plugin explicitly in the pom of a sub module, it will
not be executed?
Yes! you are right. Need to add plugin and execution with "skip=false"
explicitly in submodule to enable this. The reason for keeping in plugin
management is, all other configuration items could be controlled from one place
for all modules. Whatever needs to be specific to submodule, could be
controlled in specific module.
> And maybe we can add the test complie execution here with the skip = true
configuration, and in the sub module which also need to generate test protos
can use skip = false to enable the execution.
Yes you are right. I will do this change.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]