You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@orc.apache.org by do...@apache.org on 2022/10/24 18:54:01 UTC

[orc] branch branch-1.8 updated: ORC-1294: Fix build error when skip tests build

This is an automated email from the ASF dual-hosted git repository.

dongjoon pushed a commit to branch branch-1.8
in repository https://gitbox.apache.org/repos/asf/orc.git


The following commit(s) were added to refs/heads/branch-1.8 by this push:
     new 104fe50f9 ORC-1294: Fix build error when skip tests build
104fe50f9 is described below

commit 104fe50f941c51754aa095ed599187ae33c73513
Author: deshanxiao <de...@microsoft.com>
AuthorDate: Mon Oct 24 11:53:41 2022 -0700

    ORC-1294: Fix build error when skip tests build
    
    ### What changes were proposed in this pull request?
    This PR aims to fix build error when skip tests build. It has two modifications:
    - Add `ignoreNonCompile` in maven-dependency-plugin to skip all Runtime/Provided/Test/System scope dependency checking.
    - change slf4j-api scope to test.
    
    ### Why are the changes needed?
    The root cause of building failed is that -Dmaven.test.skip=true does not compile the test classes.
    Apache Maven Dependency Plugin will throw an error if a dependency is not used. We can use ignoreNonCompile defined in https://maven.apache.org/plugins/maven-dependency-plugin/analyze-only-mojo.html#ignoreNonCompile to avoid the problem.
    
    After adding this tag, I found that we have some classes such as slf4j-api in MapReduce module that only appear in test but scope is defined as compile. I adjusted its scope to test.
    
    For a related discussion, see https://github.com/apache/orc/issues/1277
    
    ### How was this patch tested?
    UT
    
    Closes #1286 from deshanxiao/deshan/1294.
    
    Lead-authored-by: deshanxiao <de...@microsoft.com>
    Co-authored-by: Deshan Xiao <42...@users.noreply.github.com>
    Signed-off-by: Dongjoon Hyun <do...@apache.org>
    (cherry picked from commit 4160e81714d2ccf2a20f79816c64f63eee5c85f9)
    Signed-off-by: Dongjoon Hyun <do...@apache.org>
---
 java/mapreduce/pom.xml | 5 +++--
 java/pom.xml           | 1 +
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/java/mapreduce/pom.xml b/java/mapreduce/pom.xml
index 4bbdea28f..563092139 100644
--- a/java/mapreduce/pom.xml
+++ b/java/mapreduce/pom.xml
@@ -63,12 +63,13 @@
       <groupId>org.apache.hive</groupId>
       <artifactId>hive-storage-api</artifactId>
     </dependency>
+
+    <!-- test inter-project -->
     <dependency>
       <groupId>org.slf4j</groupId>
       <artifactId>slf4j-api</artifactId>
+      <scope>test</scope>
     </dependency>
-
-    <!-- test inter-project -->
     <dependency>
       <groupId>org.apache.hadoop</groupId>
       <artifactId>hadoop-mapreduce-client-jobclient</artifactId>
diff --git a/java/pom.xml b/java/pom.xml
index 077ed2190..5bc73aae6 100644
--- a/java/pom.xml
+++ b/java/pom.xml
@@ -383,6 +383,7 @@
           </executions>
           <configuration>
             <failOnWarning>true</failOnWarning>
+            <ignoreNonCompile>true</ignoreNonCompile>
           </configuration>
         </plugin>
         <plugin>