You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by do...@apache.org on 2019/09/13 21:35:30 UTC

[spark] branch master updated: [SPARK-29075][BUILD] Add enforcer rule to ban duplicated pom dependency

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

dongjoon pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/spark.git


The following commit(s) were added to refs/heads/master by this push:
     new 8174238  [SPARK-29075][BUILD] Add enforcer rule to ban duplicated pom dependency
8174238 is described below

commit 8174238d5521795bc7c7956b38cc6c604a97c153
Author: Dongjoon Hyun <dh...@apple.com>
AuthorDate: Fri Sep 13 14:35:02 2019 -0700

    [SPARK-29075][BUILD] Add enforcer rule to ban duplicated pom dependency
    
    ### What changes were proposed in this pull request?
    
    This PR aims to add a new enforcer rule to ban duplicated pom dependency during build stage.
    
    ### Why are the changes needed?
    
    This will help us by preventing the extra effort like the followings.
    ```
    e63098b287 [SPARK-29007][MLLIB][FOLLOWUP] Remove duplicated dependency
    39e044e3d8 [MINOR][BUILD] Remove duplicate test-jar:test spark-sql dependency from Hive module
    d8fefab4d8 [HOTFIX][BUILD][TEST-MAVEN] Remove duplicate dependency
    e9445b187e [SPARK-6866][Build] Remove duplicated dependency in launcher/pom.xml
    ```
    
    ### Does this PR introduce any user-facing change?
    
    No.
    
    ### How was this patch tested?
    
    Manually.
    
    If we have something like e63098b287, it will fail at building phase at PR like the following.
    ```
    [WARNING] Rule 0: org.apache.maven.plugins.enforcer.BanDuplicatePomDependencyVersions failed with message:
    Found 1 duplicate dependency declaration in this project:
     - dependencies.dependency[org.apache.spark:spark-streaming_${scala.binary.version}:test-jar] ( 2 times )
    ...
    [INFO] ------------------------------------------------------------------------
    [INFO] BUILD FAILURE
    [ERROR] Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:3.0.0-M2:enforce (enforce-no-duplicate-dependencies) on project spark-mllib_2.12: Some Enforcer rules have failed. Look above for specific messages explaining why the rule failed. -> [Help 1]
    ```
    
    Closes #25784 from dongjoon-hyun/SPARK-29075.
    
    Authored-by: Dongjoon Hyun <dh...@apple.com>
    Signed-off-by: Dongjoon Hyun <dh...@apple.com>
---
 pom.xml | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/pom.xml b/pom.xml
index 6c474f5..f67918a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -2287,6 +2287,17 @@
                 </rules>
               </configuration>
             </execution>
+            <execution>
+              <id>enforce-no-duplicate-dependencies</id>
+              <goals>
+                <goal>enforce</goal>
+              </goals>
+              <configuration>
+                <rules>
+                  <banDuplicatePomDependencyVersions/>
+                </rules>
+              </configuration>
+            </execution>
           </executions>
         </plugin>
         <plugin>


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org