@@ -60,23 +60,12 @@ def build_pmd(into_dir:)
6060        # In CI, that's not a problem, because the workspace is always fresh. 
6161        logger . warn  "#{ @pmd_branch_name }  : Reusing already existing #{ pmd_dist_target }  " 
6262      else 
63-         logger . info  "#{ @pmd_branch_name }  : Building PMD #{ @pmd_version }  ..." 
64-         package_cmd  =  './mvnw clean package'  \
65-                       ' -Dmaven.test.skip=true'  \
66-                       ' -Dmaven.javadoc.skip=true'  \
67-                       ' -Dmaven.source.skip=true'  \
68-                       ' -Dcheckstyle.skip=true'  \
69-                       ' -Dpmd.skip=true'  \
70-                       ' -T1C -B' 
71-         logger . debug  "#{ @pmd_branch_name }  : maven command: #{ package_cmd }  " 
72-         Cmd . execute_successfully ( package_cmd ) 
73- 
63+         build_pmd_with_maven 
7464        pmd_dist_target ,  binary_exists  =  find_pmd_dist_target 
7565        unless  binary_exists 
7666          logger . error  "#{ @pmd_branch_name }  : Dist zip not found at #{ pmd_dist_target }  !" 
7767          raise  "No Dist zip found at #{ pmd_dist_target }  " 
7868        end 
79- 
8069      end 
8170
8271      logger . info  "#{ @pmd_branch_name }  : Extracting the zip" 
@@ -245,5 +234,18 @@ def find_pmd_dist_target
245234      end 
246235      [ pmd_dist_target ,  binary_exists ] 
247236    end 
237+ 
238+     def  build_pmd_with_maven 
239+       logger . info  "#{ @pmd_branch_name }  : Building PMD #{ @pmd_version }  ..." 
240+       package_cmd  =  './mvnw clean package'  \
241+                     ' -Dmaven.test.skip=true'  \
242+                     ' -Dmaven.javadoc.skip=true'  \
243+                     ' -Dmaven.source.skip=true'  \
244+                     ' -Dcheckstyle.skip=true'  \
245+                     ' -Dpmd.skip=true'  \
246+                     ' -T1C -B' 
247+       logger . debug  "#{ @pmd_branch_name }  : maven command: #{ package_cmd }  " 
248+       Cmd . execute_successfully ( package_cmd ) 
249+     end 
248250  end 
249251end 
0 commit comments