Skip to content

Commit aa5f2fb

Browse files
kumaabmneethiraj
authored andcommitted
RANGER-5019: Fix spotbug checks for sub-modules (#441)
It fixes mvn builds at sub-module level and allows 'mvn install' to run at every submodule. (cherry picked from commit 9930255)
1 parent 9043ff7 commit aa5f2fb

File tree

5 files changed

+9
-142
lines changed

5 files changed

+9
-142
lines changed

agents-common/dev-support/spotbugsIncludeFile.xml

Lines changed: 0 additions & 64 deletions
This file was deleted.

kms/dev-support/findbugsExcludeFile.xml

Lines changed: 0 additions & 48 deletions
This file was deleted.

pom.xml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,7 @@
203203
<sonar.dynamicAnalysis>reuseReports</sonar.dynamicAnalysis>
204204
<sonar.java.coveragePlugin>jacoco</sonar.java.coveragePlugin>
205205
<sonar.language>java</sonar.language>
206+
<spotbugs.failOnViolation>false</spotbugs.failOnViolation>
206207
<spotbugs.plugin.version>4.7.3.5</spotbugs.plugin.version>
207208
<spring-ldap-core.version>2.4.1</spring-ldap-core.version>
208209
<springframework.security.version>5.7.12</springframework.security.version>
@@ -659,14 +660,17 @@
659660
<groupId>com.github.spotbugs</groupId>
660661
<artifactId>spotbugs-maven-plugin</artifactId>
661662
<version>${spotbugs.plugin.version}</version>
662-
<configuration>
663-
<includeFilterFile>./dev-support/spotbugsIncludeFile.xml</includeFilterFile>
664-
</configuration>
665663
<executions>
666664
<execution>
665+
<id>spotbugs-check</id>
667666
<goals>
668667
<goal>check</goal>
669668
</goals>
669+
<phase>verify</phase>
670+
<configuration>
671+
<failOnError>${spotbugs.failOnViolation}</failOnError>
672+
<includeFilterFile>./dev-support/spotbugsIncludeFile.xml</includeFilterFile>
673+
</configuration>
670674
</execution>
671675
</executions>
672676
</plugin>

ranger-examples/dev-support/findbugsIncludeFile.xml

Lines changed: 0 additions & 25 deletions
This file was deleted.

security-admin/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1208,7 +1208,7 @@
12081208
<rules>
12091209
<evaluateBeanshell>
12101210
<message>Looks like there are multiple SQL files with same version number prefix. Update prefix and build again.</message>
1211-
<condition>List sqlFilePaths = org.codehaus.plexus.util.FileUtils.getFileNames(new File("security-admin/db"), "**/*.sql", null, false);
1211+
<condition>List sqlFilePaths = org.codehaus.plexus.util.FileUtils.getFileNames(new File("${project.basedir}/db"), "**/*.sql", null, false);
12121212
Map sqlFileMap = new HashMap();
12131213
Boolean noDupPrfx = true;
12141214

@@ -1255,7 +1255,7 @@
12551255
<rules>
12561256
<evaluateBeanshell>
12571257
<message>Looks like there are multiple JAVA files with same version number suffix. Update suffix and build again.</message>
1258-
<condition>List javaFilePaths = org.codehaus.plexus.util.FileUtils.getFileNames(new File("security-admin/src/main/java/org/apache/ranger/patch"), "**/*.java", null, false);
1258+
<condition>List javaFilePaths = org.codehaus.plexus.util.FileUtils.getFileNames(new File("${project.basedir}/src/main/java/org/apache/ranger/patch"), "**/*.java", null, false);
12591259
Map javaFileMap = new HashMap();
12601260
Boolean noDupSuffix = true;
12611261

0 commit comments

Comments
 (0)