Author: tveronezi
Date: Thu May 22 19:34:44 2014
New Revision: 1596947

URL: http://svn.apache.org/r1596947
Log:
The styles (pmd and checkstyle) will be checked by the 'style' profile.  

Added:
    tomee/tomee/trunk/src/main/style/
    tomee/tomee/trunk/src/main/style/checkstyle.xml
    tomee/tomee/trunk/src/main/style/java.header
    tomee/tomee/trunk/src/main/style/pmd/
    tomee/tomee/trunk/src/main/style/pmd/openejb-basic.xml
    tomee/tomee/trunk/src/main/style/pmd/openejb-controversial.xml
    tomee/tomee/trunk/src/main/style/pmd/openejb-empty.xml
    tomee/tomee/trunk/src/main/style/pmd/openejb-optimizations.xml
Removed:
    tomee/tomee/trunk/checkstyle.xml
Modified:
    tomee/tomee/trunk/pom.xml

Modified: tomee/tomee/trunk/pom.xml
URL: 
http://svn.apache.org/viewvc/tomee/tomee/trunk/pom.xml?rev=1596947&r1=1596946&r2=1596947&view=diff
==============================================================================
--- tomee/tomee/trunk/pom.xml (original)
+++ tomee/tomee/trunk/pom.xml Thu May 22 19:34:44 2014
@@ -41,7 +41,7 @@
   </description>
   <url>http://openejb.apache.org/</url>
   <inceptionYear>1999</inceptionYear>
-  
+
   <prerequisites>
     <maven>3.0.5</maven>
   </prerequisites>
@@ -283,13 +283,13 @@
         <plugin>
           <groupId>org.apache.maven.plugins</groupId>
           <artifactId>maven-checkstyle-plugin</artifactId>
-            <version>2.12.1</version>
+          <version>2.12.1</version>
+        </plugin>
+        <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-release-plugin</artifactId>
+          <version>2.5</version>
         </plugin>
-               <plugin>
-                 <groupId>org.apache.maven.plugins</groupId>
-                 <artifactId>maven-release-plugin</artifactId>
-                 <version>2.5</version>
-               </plugin>
       </plugins>
     </pluginManagement>
 
@@ -442,32 +442,61 @@
     <profile>
       <id>style</id>
       <modules>
+        <module>container/openejb-core</module>
       </modules>
+      <properties>
+        <style.config.dir>${user.dir}/src/main/style</style.config.dir>
+      </properties>
+      <reporting>
+        <plugins>
+          <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-jxr-plugin</artifactId>
+            <version>2.3</version>
+          </plugin>
+        </plugins>
+      </reporting>
       <build>
         <plugins>
           <plugin>
             <groupId>org.apache.maven.plugins</groupId>
             <artifactId>maven-checkstyle-plugin</artifactId>
             <configuration>
-              <sourceDirectory>
-                
${project.build.directory}/../container/openejb-core/src/main/java/org/apache/openejb/config
-              </sourceDirectory>
-              <configLocation>checkstyle.xml</configLocation>
-              <consoleOutput>true</consoleOutput>
               <enableRulesSummary>false</enableRulesSummary>
-              <failsOnError>true</failsOnError>
+              
<configLocation>${style.config.dir}/checkstyle.xml</configLocation>
+              <consoleOutput>true</consoleOutput>
+              <headerLocation>${style.config.dir}/java.header</headerLocation>
+            </configuration>
+          </plugin>
+          <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-pmd-plugin</artifactId>
+            <configuration>
+              <linkXRef>true</linkXRef>
+              <sourceEncoding>utf-8</sourceEncoding>
+              <targetJdk>1.6</targetJdk>
+              <printFailingErrors>true</printFailingErrors>
+              <rulesets>
+                <ruleset>${style.config.dir}/pmd/openejb-empty.xml</ruleset>
+                <ruleset>rulesets/java/finalizers.xml</ruleset>
+                <ruleset>rulesets/java/imports.xml</ruleset>
+                <ruleset>rulesets/java/unusedcode.xml</ruleset>
+                
<ruleset>${style.config.dir}/pmd/openejb-controversial.xml</ruleset>
+                <ruleset>${style.config.dir}/pmd/openejb-basic.xml</ruleset>
+                
<ruleset>${style.config.dir}/pmd/openejb-optimizations.xml</ruleset>
+              </rulesets>
             </configuration>
           </plugin>
         </plugins>
       </build>
       <repositories>
-               <repository>
-                 <id>patch-openjpa</id>
-                 
<url>https://repository.apache.org/content/repositories/orgapachetomee-1022/</url>
-                 <releases>
-                       <enabled>true</enabled>
-                 </releases>
-               </repository>
+        <repository>
+          <id>patch-openjpa</id>
+          
<url>https://repository.apache.org/content/repositories/orgapachetomee-1022/</url>
+          <releases>
+            <enabled>true</enabled>
+          </releases>
+        </repository>
         <repository>
           <releases>
             <enabled>false</enabled>
@@ -477,13 +506,13 @@
         </repository>
       </repositories>
       <pluginRepositories>
-               <pluginRepository>
-                 <id>patch-openjpa</id>
-                 
<url>https://repository.apache.org/content/repositories/orgapachetomee-1022/</url>
-                 <releases>
-                       <enabled>true</enabled>
-                 </releases>
-               </pluginRepository>
+        <pluginRepository>
+          <id>patch-openjpa</id>
+          
<url>https://repository.apache.org/content/repositories/orgapachetomee-1022/</url>
+          <releases>
+            <enabled>true</enabled>
+          </releases>
+        </pluginRepository>
         <pluginRepository>
           <releases>
             <enabled>false</enabled>
@@ -581,7 +610,7 @@
     <repository>
       <id>patch-openjpa</id>
       
<url>https://repository.apache.org/content/repositories/orgapachetomee-1022/</url>
-         <releases>
+      <releases>
         <enabled>true</enabled>
       </releases>
     </repository>
@@ -652,10 +681,10 @@
     <!--</repository>-->
   </repositories>
   <pluginRepositories>
-       <pluginRepository>
+    <pluginRepository>
       <id>patch-openjpa-plugin</id>
       
<url>https://repository.apache.org/content/repositories/orgapachetomee-1022/</url>
-         <releases>
+      <releases>
         <enabled>true</enabled>
       </releases>
     </pluginRepository>
@@ -1792,7 +1821,7 @@
       </dependency>
       <dependency>
         <groupId>org.apache.commons</groupId>
-               <artifactId>commons-compress</artifactId>        
+        <artifactId>commons-compress</artifactId>
         <version>1.8</version>
       </dependency>
       <dependency>

Added: tomee/tomee/trunk/src/main/style/checkstyle.xml
URL: 
http://svn.apache.org/viewvc/tomee/tomee/trunk/src/main/style/checkstyle.xml?rev=1596947&view=auto
==============================================================================
--- tomee/tomee/trunk/src/main/style/checkstyle.xml (added)
+++ tomee/tomee/trunk/src/main/style/checkstyle.xml Thu May 22 19:34:44 2014
@@ -0,0 +1,162 @@
+<?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.
+-->
+<!DOCTYPE module PUBLIC
+    "-//Puppy Crawl//DTD Check Configuration 1.2//EN"
+    "http://www.puppycrawl.com/dtds/configuration_1_2.dtd";>
+<module name="Checker">
+  <!--
+      If you set the basedir property below, then all reported file
+      names will be relative to the specified directory. See
+      http://checkstyle.sourceforge.net/5.x/config.html#Checker
+
+      <property name="basedir" value="${basedir}"/>
+  -->
+
+  <!-- Checks that property files contain the same keys.         -->
+  <!-- See http://checkstyle.sf.net/config_misc.html#Translation -->
+  <!--<module name="Translation"/>-->
+
+  <!--<module name="FileLength"/>-->
+
+  <!-- Following interprets the header file as regular expressions. -->
+  <!-- <module name="RegexpHeader"/>                                -->
+
+  <module name="FileTabCharacter">
+    <property name="eachLine" value="true"/>
+  </module>
+
+  <!--<module name="RegexpSingleline">-->
+    <!--&lt;!&ndash; \s matches whitespace character, $ matches end of line. 
&ndash;&gt;-->
+    <!--<property name="format" value="\s+$"/>-->
+    <!--<property name="message" value="Line has trailing spaces."/>-->
+  <!--</module>-->
+
+    <!-- Checks for Headers                                -->
+    <!-- See http://checkstyle.sf.net/config_header.html   -->
+     <module name="Header">
+        <property name="headerFile" value="${checkstyle.header.file}"/>
+         <property name="fileExtensions" value="java"/>
+     </module>
+
+  <module name="TreeWalker">
+
+    <property name="cacheFile" value="${checkstyle.cache.file}"/>
+
+    <!-- Checks for Javadoc comments.                     -->
+    <!-- See http://checkstyle.sf.net/config_javadoc.html -->
+    <!--<module name="JavadocMethod"/>-->
+    <!--<module name="JavadocType"/>-->
+    <!--<module name="JavadocVariable"/>-->
+    <!--<module name="JavadocStyle"/>-->
+
+
+    <!-- Checks for Naming Conventions.                  -->
+    <!-- See http://checkstyle.sf.net/config_naming.html -->
+    <!--<module name="ConstantName"/>-->
+    <module name="LocalFinalVariableName"/>
+    <module name="LocalVariableName"/>
+    <module name="MemberName"/>
+    <!--<module name="MethodName"/>-->
+    <module name="PackageName"/>
+    <module name="ParameterName"/>
+    <!--<module name="StaticVariableName"/>-->
+    <!--<module name="TypeName"/>-->
+
+
+    <!-- Checks for imports                              -->
+    <!-- See http://checkstyle.sf.net/config_import.html -->
+    <module name="IllegalImport"/>
+    <!-- defaults to sun.* packages -->
+    <module name="RedundantImport"/>
+    <module name="UnusedImports">
+      <property name="processJavadoc" value="true" />
+    </module>
+
+
+    <!-- Checks for Size Violations.                    -->
+    <!-- See http://checkstyle.sf.net/config_sizes.html -->
+    <!--<module name="LineLength">-->
+      <!--<property name="max" value="120"/>-->
+    <!--</module>-->
+    <!--<module name="MethodLength"/>-->
+    <!--<module name="ParameterNumber"/>-->
+
+
+    <!-- Checks for whitespace                               -->
+    <!-- See http://checkstyle.sf.net/config_whitespace.html -->
+    <!--<module name="EmptyForIteratorPad"/>-->
+    <!--<module name="MethodParamPad"/>-->
+    <!--<module name="NoWhitespaceAfter"/>-->
+    <!--<module name="NoWhitespaceBefore"/>-->
+    <!--<module name="OperatorWrap"/>-->
+    <!--<module name="ParenPad"/>-->
+    <!--<module name="TypecastParenPad"/>-->
+    <!--<module name="WhitespaceAfter"/>-->
+
+    <!-- Modifier Checks                                    -->
+    <!-- See http://checkstyle.sf.net/config_modifiers.html -->
+    <module name="ModifierOrder"/>
+    <module name="RedundantModifier"/>
+
+
+    <!-- Checks for blocks. You know, those {}'s         -->
+    <!-- See http://checkstyle.sf.net/config_blocks.html -->
+    <!--<module name="AvoidNestedBlocks"/>-->
+    <!--<module name="LeftCurly"/>-->
+    <module name="NeedBraces"/>
+    <!--<module name="RightCurly"/>-->
+
+
+    <!-- Checks for common coding problems               -->
+    <!-- See http://checkstyle.sf.net/config_coding.html -->
+    <!--<module name="EmptyStatement"/>-->
+    <!--<module name="EqualsHashCode"/>-->
+    <!--<module name="HiddenField">-->
+      <!--<property name="ignoreSetter" value="true"/>-->
+    <!--</module>-->
+    <module name="IllegalInstantiation"/>
+    <!--<module name="InnerAssignment"/>-->
+    <!--<module name="MagicNumber">-->
+      <!--<property name="ignoreHashCodeMethod" value="true"/>-->
+    <!--</module>-->
+    <!--<module name="MissingSwitchDefault"/>-->
+    <!--<module name="RedundantThrows"/>-->
+    <module name="SimplifyBooleanExpression"/>
+    <module name="SimplifyBooleanReturn"/>
+
+    <!-- Checks for class design                         -->
+    <!-- See http://checkstyle.sf.net/config_design.html -->
+    <module name="FinalClass"/>
+    <!--<module name="HideUtilityClassConstructor"/>-->
+    <!--<module name="InterfaceIsType"/>-->
+    <!--<module name="VisibilityModifier">-->
+      <!--<property name="packageAllowed" value="true"/>-->
+      <!--<property name="protectedAllowed" value="true"/>-->
+    <!--</module>-->
+
+    <!-- Miscellaneous other checks.                   -->
+    <!-- See http://checkstyle.sf.net/config_misc.html -->
+    <module name="ArrayTypeStyle"/>
+    <!--<module name="TodoComment"/>-->
+    <!--<module name="UpperEll"/>-->
+
+  </module>
+
+</module>

Added: tomee/tomee/trunk/src/main/style/java.header
URL: 
http://svn.apache.org/viewvc/tomee/tomee/trunk/src/main/style/java.header?rev=1596947&view=auto
==============================================================================
--- tomee/tomee/trunk/src/main/style/java.header (added)
+++ tomee/tomee/trunk/src/main/style/java.header Thu May 22 19:34:44 2014
@@ -0,0 +1,16 @@
+/*
+ * 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.
+ */
\ No newline at end of file

Added: tomee/tomee/trunk/src/main/style/pmd/openejb-basic.xml
URL: 
http://svn.apache.org/viewvc/tomee/tomee/trunk/src/main/style/pmd/openejb-basic.xml?rev=1596947&view=auto
==============================================================================
--- tomee/tomee/trunk/src/main/style/pmd/openejb-basic.xml (added)
+++ tomee/tomee/trunk/src/main/style/pmd/openejb-basic.xml Thu May 22 19:34:44 
2014
@@ -0,0 +1,38 @@
+<?xml version="1.0"?>
+<!--
+
+    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="Basic"
+         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>
+    Custom basic.xml for openejb-core
+  </description>
+
+  <!-- All the rules from basic.xml -->
+  <rule ref="rulesets/java/basic.xml">
+    <exclude name="EmptyCatchBlock"/> <!-- This is covered by the 
openejb-empty.xml file -->
+    <exclude name="CollapsibleIfStatements"/>
+    <exclude name="ReturnFromFinallyBlock"/>
+    <exclude name="AvoidBranchingStatementAsLastInLoop"/>
+    <exclude name="AvoidThreadGroup"/>
+  </rule>
+
+
+</ruleset>

Added: tomee/tomee/trunk/src/main/style/pmd/openejb-controversial.xml
URL: 
http://svn.apache.org/viewvc/tomee/tomee/trunk/src/main/style/pmd/openejb-controversial.xml?rev=1596947&view=auto
==============================================================================
--- tomee/tomee/trunk/src/main/style/pmd/openejb-controversial.xml (added)
+++ tomee/tomee/trunk/src/main/style/pmd/openejb-controversial.xml Thu May 22 
19:34:44 2014
@@ -0,0 +1,46 @@
+<?xml version="1.0"?>
+<!--
+
+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="Basic"
+         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>
+    Custom controversial.xml for openejb-core
+  </description>
+
+  <rule ref="rulesets/java/controversial.xml">
+    <exclude name="DataflowAnomalyAnalysis"/>
+    <exclude name="OnlyOneReturn"/>
+    <exclude name="AvoidFinalLocalVariable"/>
+    <exclude name="NullAssignment"/>
+    <exclude name="AvoidLiteralsInIfCondition"/>
+    <exclude name="AtLeastOneConstructor"/>
+    <exclude name="UseConcurrentHashMap"/>
+    <exclude name="AvoidPrefixingMethodParameters"/>
+    <exclude name="CallSuperInConstructor"/>
+    <exclude name="DefaultPackage"/>
+    <exclude name="AvoidUsingShortType"/>
+    <exclude name="UseObjectForClearerAPI"/>
+    <exclude name="AvoidUsingVolatile"/>
+    <exclude name="AssignmentInOperand"/>
+    <exclude name="BooleanInversion"/>
+  </rule>
+
+</ruleset>

Added: tomee/tomee/trunk/src/main/style/pmd/openejb-empty.xml
URL: 
http://svn.apache.org/viewvc/tomee/tomee/trunk/src/main/style/pmd/openejb-empty.xml?rev=1596947&view=auto
==============================================================================
--- tomee/tomee/trunk/src/main/style/pmd/openejb-empty.xml (added)
+++ tomee/tomee/trunk/src/main/style/pmd/openejb-empty.xml Thu May 22 19:34:44 
2014
@@ -0,0 +1,40 @@
+<?xml version="1.0"?>
+<!--
+
+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="Basic"
+         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>
+    Custom empty.xml for openejb-core
+  </description>
+
+  <!-- All the rules from empty.xml -->
+  <rule ref="rulesets/java/empty.xml">
+    <exclude name="EmptyCatchBlock"/>
+  </rule>
+
+  <!-- overriding EmptyCatchBlock -->
+  <rule ref="rulesets/java/empty.xml/EmptyCatchBlock">
+    <properties>
+      <property name="allowCommentedBlocks" value="true"/>
+    </properties>
+  </rule>
+
+</ruleset>

Added: tomee/tomee/trunk/src/main/style/pmd/openejb-optimizations.xml
URL: 
http://svn.apache.org/viewvc/tomee/tomee/trunk/src/main/style/pmd/openejb-optimizations.xml?rev=1596947&view=auto
==============================================================================
--- tomee/tomee/trunk/src/main/style/pmd/openejb-optimizations.xml (added)
+++ tomee/tomee/trunk/src/main/style/pmd/openejb-optimizations.xml Thu May 22 
19:34:44 2014
@@ -0,0 +1,38 @@
+<?xml version="1.0"?>
+<!--
+
+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="Basic"
+         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>
+    Custom optimizations.xml for openejb-core
+  </description>
+
+  <!-- All the rules from basic.xml -->
+  <rule ref="rulesets/java/optimizations.xml">
+    <exclude name="PrematureDeclaration"/> <!-- this rule is buggy -->
+    <exclude name="AvoidInstantiatingObjectsInLoops"/>
+    <exclude name="RedundantFieldInitializer"/>
+    <exclude name="SimplifyStartsWith"/>
+    <exclude name="UseStringBufferForStringAppends"/>
+    <exclude name="UseArrayListInsteadOfVector"/>
+  </rule>
+
+</ruleset>


Reply via email to