[ 
https://issues.apache.org/jira/browse/HADOOP-18398?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17577897#comment-17577897
 ] 

ASF GitHub Bot commented on HADOOP-18398:
-----------------------------------------

eubnara opened a new pull request, #4727:
URL: https://github.com/apache/hadoop/pull/4727

   <!--
     Thanks for sending a pull request!
       1. If this is your first time, please read our contributor guidelines: 
https://cwiki.apache.org/confluence/display/HADOOP/How+To+Contribute
       2. Make sure your PR title starts with JIRA issue id, e.g., 
'HADOOP-17799. Your PR title ...'.
   -->
   
   ### Description of PR
   
   This PR fixes build failure caused by duplicate classes of AvroRecord in 
both hadoop-client-minicluster and hadoop-client-api jar.
   
   ### How was this patch tested?
   
   By building sources by myself.
   
   ### For code changes:
   
   - [x] Does the title or this PR starts with the corresponding JIRA issue id 
(e.g. 'HADOOP-17799. Your PR title ...')?
   - [ ] Object storage: have the integration tests been executed and the 
endpoint declared according to the connector-specific documentation?
   - [ ] If adding new dependencies to the code, are these dependencies 
licensed in a way that is compatible for inclusion under [ASF 
2.0](http://www.apache.org/legal/resolved.html#category-a)?
   - [ ] If applicable, have you updated the `LICENSE`, `LICENSE-binary`, 
`NOTICE-binary` files?
   
   




> Prevent AvroRecord*.class from being included non-test jar
> ----------------------------------------------------------
>
>                 Key: HADOOP-18398
>                 URL: https://issues.apache.org/jira/browse/HADOOP-18398
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: common
>    Affects Versions: 3.3.3, 3.3.4
>            Reporter: YUBI LEE
>            Priority: Major
>
> bq. 
> {code}
> [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] 
> {code}
> 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.
> https://github.com/apache/hadoop/blob/rel/release-3.3.4/hadoop-common-project/hadoop-common/pom.xml#L1118
> {code:xml}
>               <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>
> {code}
> "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".



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to