Copilot commented on code in PR #530:
URL: https://github.com/apache/atlas/pull/530#discussion_r2819384748


##########
webapp/pom.xml:
##########
@@ -525,6 +566,13 @@
                             
<directory>${project.build.directory}/api/v2/apidocs/ui</directory>
                             <targetPath>apidocs</targetPath>
                         </resource>
+                        <resource>
+                            <directory>${project.build.directory}</directory>
+                            <includes>
+                                
<include>hbase-shaded-client-${hbase.version}-hadoop3-fixed.jar</include>
+                            </includes>

Review Comment:
   This adds a repacked “fixed” hbase-shaded-client JAR into WEB-INF/lib, but 
the original hbase-shaded-client-${hbase.version}-hadoop3.jar is only excluded 
via packages.to.exclude in a few profiles. In a default build where that 
property isn’t set, both JARs can end up packaged, reintroducing the 
service-provider conflict you’re trying to avoid. Consider excluding the 
original JAR unconditionally (e.g., add it directly to maven-war-plugin 
<packagingExcludes> or define a default packages.to.exclude in the main 
<properties> and append in profiles).



##########
webapp/pom.xml:
##########
@@ -500,6 +501,46 @@
 
     <build>
         <plugins>
+            <plugin>
+                <artifactId>maven-dependency-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>unpack-hbase-shaded-client</id>
+                        <goals>
+                            <goal>unpack</goal>
+                        </goals>
+                        <phase>process-resources</phase>
+                        <configuration>
+                            <artifactItems>
+                                <artifactItem>
+                                    <groupId>org.apache.hbase</groupId>
+                                    
<artifactId>hbase-shaded-client</artifactId>
+                                    <version>${hbase.version}-hadoop3</version>
+                                    
<outputDirectory>${project.build.directory}/hbase-shaded-client-fixed</outputDirectory>
+                                    
<excludes>META-INF/services/javax.ws.rs.ext.MessageBodyWriter,META-INF/services/javax.ws.rs.ext.MessageBodyReader</excludes>
+                                </artifactItem>
+                            </artifactItems>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <artifactId>maven-jar-plugin</artifactId>
+                <version>${maven-jar-plugin.version}</version>
+                <executions>
+                    <execution>
+                        <id>repack-hbase-shaded-client</id>
+                        <goals>
+                            <goal>jar</goal>
+                        </goals>
+                        <phase>prepare-package</phase>
+                        <configuration>
+                            
<classesDirectory>${project.build.directory}/hbase-shaded-client-fixed</classesDirectory>
+                            
<finalName>hbase-shaded-client-${hbase.version}-hadoop3-fixed</finalName>

Review Comment:
   The maven-jar-plugin execution repacks a JAR inside a module with 
<packaging>war</packaging>. With no <classifier>, this goal can 
overwrite/replace the module’s main artifact during the build (potentially 
producing/attaching a JAR instead of the WAR or confusing downstream reactor 
builds). Configure this execution to attach the repacked JAR under a classifier 
(or otherwise ensure it does not replace the project’s primary artifact).
   ```suggestion
                               
<finalName>hbase-shaded-client-${hbase.version}-hadoop3-fixed</finalName>
                               
<classifier>hbase-shaded-client-fixed</classifier>
   ```



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to