Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
3.3.3, 3.3.4
Description
[WARNING] Rule 1: org.apache.maven.plugins.enforcer.BanDuplicateClasses failed with message:
Duplicate classes found:
Found in:
org.apache.hadoop:hadoop-client-minicluster:jar:3.3.4:compile
org.apache.hadoop:hadoop-client-api:jar:3.3.4:compile
Duplicate classes:
org/apache/hadoop/io/serializer/avro/AvroRecord.class
org/apache/hadoop/io/serializer/avro/AvroRecord$Builder.class
org/apache/hadoop/io/serializer/avro/AvroRecord$1.class
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:3.0.0-M1:enforce (enforce-banned-dependencies) on project hadoop-client-check-test-invariants: Some Enforcer rules have failed. Look above for specific messages explaining why the rule failed. -> [Help 1]
When building Hadoop, AvroRecord*.class are included in hadoop-client-api jar and I think it is wrong.
It is caused by "protobuf-maven-plugin" as a side effect.
<execution> <id>src-test-compile-protoc-legacy</id> <phase>generate-test-sources</phase> <goals> <goal>compile</goal> </goals> <configuration> <skip>false</skip> <!--Generating with old protobuf version for backward compatibility--> <protocArtifact> com.google.protobuf:protoc:${protobuf.version}:exe:${os.detected.classifier} </protocArtifact> <includeDependenciesInDescriptorSet>false</includeDependenciesInDescriptorSet> <protoSourceRoot>${basedir}/src/test/proto</protoSourceRoot> <outputDirectory>${project.build.directory}/generated-test-sources/java</outputDirectory> <clearOutputDirectory>false</clearOutputDirectory> <includes> <include>test_legacy.proto</include> <include>test_rpc_service_legacy.proto</include> </includes> </configuration> </execution>
"src-test-compile-protoc-legacy" 's goal is written "compile" wrongly. It makes outputDirectory (${project.build.directory}/generated-test-sources/java) to be added to "compileSourceRoots" of maven-compiler-plugin.
"src-test-compile-protoc-legacy" 's goal should be "test-compile".
Attachments
Issue Links
- links to