Repository: incubator-ranger
Updated Branches:
  refs/heads/master fe0858a6c -> 4f6c35146


RANGER-822: Added mvn plugin to analyze source code during the verification 
process


Project: http://git-wip-us.apache.org/repos/asf/incubator-ranger/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ranger/commit/2ea6975b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ranger/tree/2ea6975b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ranger/diff/2ea6975b

Branch: refs/heads/master
Commit: 2ea6975bcc2c5d148647d6410a84ed3f85c6e1af
Parents: 7f451e6
Author: sneethiraj <[email protected]>
Authored: Tue Jan 26 01:19:39 2016 -0500
Committer: sneethiraj <[email protected]>
Committed: Tue Jan 26 01:19:39 2016 -0500

----------------------------------------------------------------------
 dev-support/ranger-pmd-ruleset.xml | 80 +++++++++++++++++++++++++++++++++
 pom.xml                            | 26 +++++++++++
 2 files changed, 106 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/2ea6975b/dev-support/ranger-pmd-ruleset.xml
----------------------------------------------------------------------
diff --git a/dev-support/ranger-pmd-ruleset.xml 
b/dev-support/ranger-pmd-ruleset.xml
new file mode 100644
index 0000000..1f74845
--- /dev/null
+++ b/dev-support/ranger-pmd-ruleset.xml
@@ -0,0 +1,80 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<ruleset name="ranger-pmd" xmlns="http://pmd.sourceforge.net/ruleset/2.0.0";
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+    xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 
http://pmd.sourceforge.net/ruleset_2_0_0.xsd";>
+  <description>
+     Apache Ranger - PMD rule set
+  </description>
+
+  <rule ref="rulesets/java/basic.xml">
+       <exclude name="AvoidBranchingStatementAsLastInLoop" />
+       <exclude name="AvoidThreadGroup" />
+       <exclude name="AvoidUsingHardCodedIP" />
+       <exclude name="BooleanInstantiation" />
+       <exclude name="ClassCastExceptionWithToArray" />
+       <exclude name="CollapsibleIfStatements" />
+       <exclude name="DoubleCheckedLocking" />
+       <exclude name="ExtendsObject" />
+       <exclude name="OverrideBothEqualsAndHashcode" />
+  </rule>
+  <rule ref="rulesets/java/unusedcode.xml">
+       <exclude name="UnusedFormalParameter" />
+       <exclude name="UnusedLocalVariable" />
+       <exclude name="UnusedModifier" />
+       <exclude name="UnusedPrivateField" />
+       <exclude name="UnusedPrivateMethod" />
+  </rule>
+  <rule ref="rulesets/java/imports.xml" >
+       <exclude name="DontImportJavaLang" />
+       <exclude name="DuplicateImports" />
+       <exclude name="ImportFromSamePackage" />
+       <exclude name="UnnecessaryFullyQualifiedName" />
+       <exclude name="UnusedImports" />
+  </rule>
+  <rule ref="rulesets/java/braces.xml">
+       <exclude name="ForLoopsMustUseBraces" />
+       <exclude name="IfElseStmtsMustUseBraces" />
+       <exclude name="IfStmtsMustUseBraces" />
+  </rule>
+  <rule ref="rulesets/java/empty.xml">
+       <exclude name="EmptyCatchBlock" />
+       <exclude name="EmptyFinallyBlock" />
+       <exclude name="EmptyIfStmt" />
+       <exclude name="EmptyStatementNotInLoop" />
+       <exclude name="EmptyWhileStmt" />
+  </rule>
+  <rule ref="rulesets/java/migrating.xml">
+       <exclude name="IntegerInstantiation" />
+       <exclude name="JUnit4TestShouldUseTestAnnotation" />
+       <exclude name="LongInstantiation" />
+       <exclude name="ReplaceEnumerationWithIterator" />
+       <exclude name="ReplaceHashtableWithMap" />
+  </rule>
+  <rule ref="rulesets/java/unnecessary.xml">
+       <exclude name="UnnecessaryConversionTemporary" />
+       <exclude name="UnnecessaryReturn" />
+       <exclude name="UnusedNullCheckInEquals" />
+       <exclude name="UselessOverridingMethod" />
+       <exclude name="UselessParentheses" />
+       <exclude name="UnnecessaryFinalModifier" />
+  </rule>
+
+</ruleset>

http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/2ea6975b/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 23ef49e..f602040 100644
--- a/pom.xml
+++ b/pom.xml
@@ -471,6 +471,32 @@
     </pluginManagement>
     <plugins>
 
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-pmd-plugin</artifactId>
+        <version>3.5</version>
+        <executions>
+          <execution>
+            <phase>verify</phase>
+            <goals>
+              <goal>check</goal>
+            </goals>
+          </execution>
+        </executions>
+        <configuration>
+          <rulesets>
+            
<ruleset>${project.parent.basedir}/dev-support/ranger-pmd-ruleset.xml</ruleset>
+          </rulesets>
+          <sourceEncoding>UTF-8</sourceEncoding>
+          <failOnViolation>true</failOnViolation>
+          <linkXRef>false</linkXRef>
+          <verbose>true</verbose>
+          <excludeRoots>
+            <excludeRoot>${basedir}/src/main/generated</excludeRoot>
+          </excludeRoots>
+        </configuration>
+      </plugin>
+
     <plugin>
       <groupId>org.apache.rat</groupId>
       <artifactId>apache-rat-plugin</artifactId>

Reply via email to