Sfoglia il codice sorgente

checkstyle pom re-org

jrivard@gmail.com 6 anni fa
parent
commit
95f2b9eacf

+ 2 - 0
build/checkstyle-import.xml

@@ -37,6 +37,8 @@
     <allow pkg="java.lang"/>
     <allow pkg="java.lang"/>
     <allow pkg="java.security"/>
     <allow pkg="java.security"/>
 
 
+    <allow pkg="org.apache.catalina"/>
+
     <!-- chai -->
     <!-- chai -->
     <allow pkg="com.novell.ldapchai"/>
     <allow pkg="com.novell.ldapchai"/>
 
 

+ 5 - 5
build/checkstyle.xml

@@ -32,19 +32,19 @@
 <module name="Checker">
 <module name="Checker">
 
 
     <module name="Header">
     <module name="Header">
-        <property name="headerFile" value="${basedir}/../build/license-header-jsp.txt"/>
+        <property name="headerFile" value="${basedir}/build/license-header-jsp.txt"/>
         <property name="fileExtensions" value="jsp"/>
         <property name="fileExtensions" value="jsp"/>
     </module>
     </module>
     <module name="Header">
     <module name="Header">
-        <property name="headerFile" value="${basedir}/../build/license-header-java.txt"/>
+        <property name="headerFile" value="${basedir}/build/license-header-java.txt"/>
         <property name="fileExtensions" value="java,css"/>
         <property name="fileExtensions" value="java,css"/>
     </module>
     </module>
     <module name="Header">
     <module name="Header">
-        <property name="headerFile" value="${basedir}/../build/license-header-xml.txt"/>
+        <property name="headerFile" value="${basedir}/build/license-header-xml.txt"/>
         <property name="fileExtensions" value="xml,svg"/>
         <property name="fileExtensions" value="xml,svg"/>
     </module>
     </module>
     <module name="Header">
     <module name="Header">
-        <property name="headerFile" value="${basedir}/../build/license-header-properties.txt"/>
+        <property name="headerFile" value="${basedir}/build/license-header-properties.txt"/>
         <property name="fileExtensions" value="properties"/>
         <property name="fileExtensions" value="properties"/>
     </module>
     </module>
 
 
@@ -179,7 +179,7 @@
         <module name="RedundantImport"/>
         <module name="RedundantImport"/>
         <module name="UnusedImports"/>
         <module name="UnusedImports"/>
         <module name="ImportControl">
         <module name="ImportControl">
-            <property name="file" value="${basedir}/../build/checkstyle-import.xml"/>
+            <property name="file" value="${basedir}/build/checkstyle-import.xml"/>
         </module>
         </module>
 
 
 
 

+ 4 - 0
client/pom.xml

@@ -14,6 +14,10 @@
 
 
     <name>PWM Password Self Service: Client</name>
     <name>PWM Password Self Service: Client</name>
 
 
+    <properties>
+        <project.root.basedir>${project.basedir}/..</project.root.basedir>
+    </properties>
+
     <build>
     <build>
         <plugins>
         <plugins>
             <plugin>
             <plugin>

+ 1 - 39
data-service/pom.xml

@@ -33,6 +33,7 @@
         <timestamp.iso>${maven.build.timestamp}</timestamp.iso>
         <timestamp.iso>${maven.build.timestamp}</timestamp.iso>
         <maven.build.timestamp.format>yyyy-MM-dd'T'HH:mm:ss'Z'</maven.build.timestamp.format>
         <maven.build.timestamp.format>yyyy-MM-dd'T'HH:mm:ss'Z'</maven.build.timestamp.format>
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+        <project.root.basedir>${project.basedir}/..</project.root.basedir>
     </properties>
     </properties>
 
 
     <profiles>
     <profiles>
@@ -42,12 +43,6 @@
                 <skipTests>true</skipTests>
                 <skipTests>true</skipTests>
             </properties>
             </properties>
         </profile>
         </profile>
-        <profile>
-            <id>skip-checkstyle</id>
-            <properties>
-                <checkstyle.skip>true</checkstyle.skip>
-            </properties>
-        </profile>
     </profiles>
     </profiles>
 
 
     <build>
     <build>
@@ -129,39 +124,6 @@
                     </archive>
                     </archive>
                 </configuration>
                 </configuration>
             </plugin>
             </plugin>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-checkstyle-plugin</artifactId>
-                <version>3.0.0</version>
-                <dependencies>
-                    <dependency>
-                        <groupId>com.puppycrawl.tools</groupId>
-                        <artifactId>checkstyle</artifactId>
-                        <version>8.11</version>
-                    </dependency>
-                </dependencies>
-                <executions>
-                    <execution>
-                        <id>validate</id>
-                        <phase>validate</phase>
-                        <configuration>
-                            <propertyExpansion>basedir=${basedir}</propertyExpansion>
-                            <configLocation>../build/checkstyle.xml</configLocation>
-                            <encoding>UTF-8</encoding>
-                            <consoleOutput>true</consoleOutput>
-                            <includeTestResources>false</includeTestResources>
-                            <failsOnError>true</failsOnError>
-                            <includes>**/*.java,**/*.jsp,**/*.properties,**/*.xml,**/*.css,**/*.svg</includes>
-                            <sourceDirectories>
-                                <directory>src/main</directory>
-                            </sourceDirectories>
-                        </configuration>
-                        <goals>
-                            <goal>check</goal>
-                        </goals>
-                    </execution>
-                </executions>
-            </plugin>
             <plugin>
             <plugin>
                 <artifactId>maven-resources-plugin</artifactId>
                 <artifactId>maven-resources-plugin</artifactId>
                 <version>2.7</version>
                 <version>2.7</version>

+ 1 - 0
docker/pom.xml

@@ -17,6 +17,7 @@
 
 
     <properties>
     <properties>
         <skipDocker>false</skipDocker>
         <skipDocker>false</skipDocker>
+        <project.root.basedir>${project.basedir}/..</project.root.basedir>
     </properties>
     </properties>
 
 
     <profiles>
     <profiles>

+ 1 - 2
onejar/pom.xml

@@ -16,10 +16,9 @@
     <name>PWM Password Self Service: Executable JAR</name>
     <name>PWM Password Self Service: Executable JAR</name>
 
 
     <properties>
     <properties>
+        <project.root.basedir>${project.basedir}/..</project.root.basedir>
         <tomcat.version>9.0.10</tomcat.version>
         <tomcat.version>9.0.10</tomcat.version>
         <jetty-version>9.4.11.v20180605</jetty-version>
         <jetty-version>9.4.11.v20180605</jetty-version>
-
-
     </properties>
     </properties>
 
 
     <build>
     <build>

+ 3 - 3
onejar/src/main/java/password/pwm/onejar/TomcatOneJarMain.java

@@ -201,7 +201,7 @@ public class TomcatOneJarMain
         final File redirBase = new File( onejarConfig.getWorkingPath().getAbsoluteFile() + File.separator + "redirectBase" );
         final File redirBase = new File( onejarConfig.getWorkingPath().getAbsoluteFile() + File.separator + "redirectBase" );
         redirBase.mkdirs();
         redirBase.mkdirs();
         {
         {
-            new File (redirBase.getAbsolutePath() + File.separator + "WEB-INF" ).mkdirs();
+            new File ( redirBase.getAbsolutePath() + File.separator + "WEB-INF" ).mkdirs();
             copyFileAndReplace(
             copyFileAndReplace(
                     srcRootWebXml,
                     srcRootWebXml,
                     redirBase.getPath() + File.separator + "WEB-INF" + File.separator + "web.xml",
                     redirBase.getPath() + File.separator + "WEB-INF" + File.separator + "web.xml",
@@ -332,8 +332,8 @@ public class TomcatOneJarMain
             throws IOException
             throws IOException
     {
     {
         final InputStream inputStream = TomcatOneJarMain.class.getClassLoader().getResourceAsStream( srcPath );
         final InputStream inputStream = TomcatOneJarMain.class.getClassLoader().getResourceAsStream( srcPath );
-        String contents = new BufferedReader(new InputStreamReader(inputStream)).lines().collect( Collectors.joining("\n"));
+        String contents = new BufferedReader( new InputStreamReader( inputStream ) ).lines().collect( Collectors.joining( "\n" ) );
         contents = contents.replace( "[[[ROOT_CONTEXT]]]", rootcontext );
         contents = contents.replace( "[[[ROOT_CONTEXT]]]", rootcontext );
-        Files.write( Paths.get( destPath ), contents.getBytes());
+        Files.write( Paths.get( destPath ), contents.getBytes() );
     }
     }
 }
 }

+ 22 - 0
onejar/src/main/resources/ROOT-redirect-webapp/WEB-INF/index.jsp

@@ -1,2 +1,24 @@
+<%--
+ ~ Password Management Servlets (PWM)
+ ~ http://www.pwm-project.org
+ ~
+ ~ Copyright (c) 2006-2009 Novell, Inc.
+ ~ Copyright (c) 2009-2018 The PWM Project
+ ~
+ ~ This program is free software; you can redistribute it and/or modify
+ ~ it under the terms of the GNU General Public License as published by
+ ~ the Free Software Foundation; either version 2 of the License, or
+ ~ (at your option) any later version.
+ ~
+ ~ This program is distributed in the hope that it will be useful,
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ ~ GNU General Public License for more details.
+ ~
+ ~ You should have received a copy of the GNU General Public License
+ ~ along with this program; if not, write to the Free Software
+ ~ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+--%>
+
 <%@ page session="false" contentType="text/html" %>
 <%@ page session="false" contentType="text/html" %>
 <html><head><meta http-equiv="refresh" content="0;URL='/[[[ROOT_CONTEXT]]]'"/></head></html>
 <html><head><meta http-equiv="refresh" content="0;URL='/[[[ROOT_CONTEXT]]]'"/></head></html>

+ 19 - 0
onejar/src/main/resources/ROOT-redirect-webapp/WEB-INF/web.xml

@@ -1,4 +1,23 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Password Management Servlets (PWM)
+  ~ Copyright (c) 2006-2018 Novell, Inc.
+  ~
+  ~ This program is free software; you can redistribute it and/or modify
+  ~ it under the terms of the GNU General Public License as published by
+  ~ the Free Software Foundation; either version 2 of the License, or
+  ~ (at your option) any later version.
+  ~
+  ~ This program is distributed in the hope that it will be useful,
+  ~ but WITHOUT ANY WARRANTY; without even the implied warranty of
+  ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  ~ GNU General Public License for more details.
+  ~
+  ~ You should have received a copy of the GNU General Public License
+  ~ along with this program; if not, write to the Free Software
+  ~ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+  -->
+
 <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xmlns="http://java.sun.com/xml/ns/javaee"
          xmlns="http://java.sun.com/xml/ns/javaee"
          xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
          xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"

+ 43 - 0
pom.xml

@@ -31,6 +31,7 @@
         <timestamp.iso>${maven.build.timestamp}</timestamp.iso>
         <timestamp.iso>${maven.build.timestamp}</timestamp.iso>
         <maven.compiler.source>1.8</maven.compiler.source>
         <maven.compiler.source>1.8</maven.compiler.source>
         <maven.compiler.target>1.8</maven.compiler.target>
         <maven.compiler.target>1.8</maven.compiler.target>
+        <project.root.basedir>${project.basedir}</project.root.basedir>
     </properties>
     </properties>
 
 
     <modules>
     <modules>
@@ -43,6 +44,15 @@
         <module>docker</module>
         <module>docker</module>
     </modules>
     </modules>
 
 
+    <profiles>
+        <profile>
+            <id>skip-checkstyle</id>
+            <properties>
+                <checkstyle.skip>true</checkstyle.skip>
+            </properties>
+        </profile>
+    </profiles>
+
     <build>
     <build>
         <plugins>
         <plugins>
             <plugin>
             <plugin>
@@ -74,6 +84,39 @@
                     <target>${maven.compiler.target}</target>
                     <target>${maven.compiler.target}</target>
                 </configuration>
                 </configuration>
             </plugin>
             </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-checkstyle-plugin</artifactId>
+                <version>3.0.0</version>
+                <dependencies>
+                    <dependency>
+                        <groupId>com.puppycrawl.tools</groupId>
+                        <artifactId>checkstyle</artifactId>
+                        <version>8.11</version>
+                    </dependency>
+                </dependencies>
+                <executions>
+                    <execution>
+                        <id>validate</id>
+                        <phase>validate</phase>
+                        <configuration>
+                            <propertyExpansion>basedir=${project.root.basedir}</propertyExpansion>
+                            <configLocation>${project.root.basedir}/build/checkstyle.xml</configLocation>
+                            <encoding>UTF-8</encoding>
+                            <consoleOutput>true</consoleOutput>
+                            <includeTestResources>false</includeTestResources>
+                            <failsOnError>true</failsOnError>
+                            <includes>**/*.java,**/*.jsp,**/*.properties,**/*.xml,**/*.css,**/*.svg</includes>
+                            <sourceDirectories>
+                                <directory>src/main</directory>
+                            </sourceDirectories>
+                        </configuration>
+                        <goals>
+                            <goal>check</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
         </plugins>
         </plugins>
     </build>
     </build>
 
 

+ 5 - 40
rest-test-service/pom.xml

@@ -9,11 +9,15 @@
 
 
     <modelVersion>4.0.0</modelVersion>
     <modelVersion>4.0.0</modelVersion>
 
 
-    <artifactId>rest-test-server</artifactId>
+    <artifactId>rest-test-service</artifactId>
     <packaging>war</packaging>
     <packaging>war</packaging>
 
 
     <name>PWM Password Self Service: Web Service Test Server</name>
     <name>PWM Password Self Service: Web Service Test Server</name>
 
 
+    <properties>
+        <project.root.basedir>${project.basedir}/..</project.root.basedir>
+    </properties>
+
     <profiles>
     <profiles>
         <profile>
         <profile>
             <id>skip-tests</id>
             <id>skip-tests</id>
@@ -27,12 +31,6 @@
                 <maven.javadoc.skip>true</maven.javadoc.skip>
                 <maven.javadoc.skip>true</maven.javadoc.skip>
             </properties>
             </properties>
         </profile>
         </profile>
-        <profile>
-            <id>skip-checkstyle</id>
-            <properties>
-                <checkstyle.skip>true</checkstyle.skip>
-            </properties>
-        </profile>
         <profile>
         <profile>
             <id>skip-spotbugs</id>
             <id>skip-spotbugs</id>
             <properties>
             <properties>
@@ -146,39 +144,6 @@
                     </archive>
                     </archive>
                 </configuration>
                 </configuration>
             </plugin>
             </plugin>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-checkstyle-plugin</artifactId>
-                <version>3.0.0</version>
-                <dependencies>
-                    <dependency>
-                        <groupId>com.puppycrawl.tools</groupId>
-                        <artifactId>checkstyle</artifactId>
-                        <version>8.11</version>
-                    </dependency>
-                </dependencies>
-                <executions>
-                    <execution>
-                        <id>validate</id>
-                        <phase>validate</phase>
-                        <configuration>
-                            <propertyExpansion>basedir=${basedir}</propertyExpansion>
-                            <configLocation>../build/checkstyle.xml</configLocation>
-                            <encoding>UTF-8</encoding>
-                            <consoleOutput>true</consoleOutput>
-                            <includeTestResources>false</includeTestResources>
-                            <failsOnError>true</failsOnError>
-                            <includes>**/*.java,**/*.jsp,**/*.properties,**/*.xml,**/*.css,**/*.svg</includes>
-                            <sourceDirectories>
-                                <directory>src/main</directory>
-                            </sourceDirectories>
-                        </configuration>
-                        <goals>
-                            <goal>check</goal>
-                        </goals>
-                    </execution>
-                </executions>
-            </plugin>
         </plugins>
         </plugins>
     </build>
     </build>
 
 

+ 3 - 41
server/pom.xml

@@ -15,6 +15,7 @@
     <name>PWM Password Self Service: Server JAR</name>
     <name>PWM Password Self Service: Server JAR</name>
 
 
     <properties>
     <properties>
+        <project.root.basedir>${project.basedir}/..</project.root.basedir>
         <skipTests>false</skipTests>
         <skipTests>false</skipTests>
         <skipSpotbugs>false</skipSpotbugs>
         <skipSpotbugs>false</skipSpotbugs>
     </properties>
     </properties>
@@ -32,12 +33,6 @@
                 <maven.javadoc.skip>true</maven.javadoc.skip>
                 <maven.javadoc.skip>true</maven.javadoc.skip>
             </properties>
             </properties>
         </profile>
         </profile>
-        <profile>
-            <id>skip-checkstyle</id>
-            <properties>
-                <checkstyle.skip>true</checkstyle.skip>
-            </properties>
-        </profile>
         <profile>
         <profile>
             <id>skip-spotbugs</id>
             <id>skip-spotbugs</id>
             <properties>
             <properties>
@@ -192,39 +187,6 @@
                     </archive>
                     </archive>
                 </configuration>
                 </configuration>
             </plugin>
             </plugin>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-checkstyle-plugin</artifactId>
-                <version>3.0.0</version>
-                <dependencies>
-                    <dependency>
-                        <groupId>com.puppycrawl.tools</groupId>
-                        <artifactId>checkstyle</artifactId>
-                        <version>8.11</version>
-                    </dependency>
-                </dependencies>
-                <executions>
-                    <execution>
-                        <id>validate</id>
-                        <phase>validate</phase>
-                        <configuration>
-                            <propertyExpansion>basedir=${basedir}</propertyExpansion>
-                            <configLocation>../build/checkstyle.xml</configLocation>
-                            <encoding>UTF-8</encoding>
-                            <consoleOutput>true</consoleOutput>
-                            <includeTestResources>false</includeTestResources>
-                            <failsOnError>true</failsOnError>
-                            <includes>**/*.java,**/*.jsp,**/*.properties,**/*.xml,**/*.css,**/*.svg</includes>
-                            <sourceDirectories>
-                                <directory>src/main</directory>
-                            </sourceDirectories>
-                        </configuration>
-                        <goals>
-                            <goal>check</goal>
-                        </goals>
-                    </execution>
-                </executions>
-            </plugin>
             <plugin>
             <plugin>
                 <artifactId>maven-resources-plugin</artifactId>
                 <artifactId>maven-resources-plugin</artifactId>
                 <version>2.7</version>
                 <version>2.7</version>
@@ -445,13 +407,13 @@
         <dependency>
         <dependency>
             <groupId>org.mockito</groupId>
             <groupId>org.mockito</groupId>
             <artifactId>mockito-core</artifactId>
             <artifactId>mockito-core</artifactId>
-            <version>2.13.0</version>
+            <version>2.21.0</version>
             <scope>test</scope>
             <scope>test</scope>
         </dependency>
         </dependency>
         <dependency>
         <dependency>
             <groupId>org.assertj</groupId>
             <groupId>org.assertj</groupId>
             <artifactId>assertj-core</artifactId>
             <artifactId>assertj-core</artifactId>
-            <version>3.9.1</version>
+            <version>3.10.0</version>
             <scope>test</scope>
             <scope>test</scope>
         </dependency>
         </dependency>
         <dependency>
         <dependency>

+ 1 - 71
webapp/pom.xml

@@ -17,6 +17,7 @@
     <properties>
     <properties>
         <skipTests>false</skipTests>
         <skipTests>false</skipTests>
         <skipSpotbugs>false</skipSpotbugs>
         <skipSpotbugs>false</skipSpotbugs>
+        <project.root.basedir>${project.basedir}/..</project.root.basedir>
     </properties>
     </properties>
 
 
     <profiles>
     <profiles>
@@ -32,12 +33,6 @@
                 <maven.javadoc.skip>true</maven.javadoc.skip>
                 <maven.javadoc.skip>true</maven.javadoc.skip>
             </properties>
             </properties>
         </profile>
         </profile>
-        <profile>
-            <id>skip-checkstyle</id>
-            <properties>
-                <checkstyle.skip>true</checkstyle.skip>
-            </properties>
-        </profile>
         <profile>
         <profile>
             <id>skip-spotbugs</id>
             <id>skip-spotbugs</id>
             <properties>
             <properties>
@@ -191,39 +186,6 @@
                     </archive>
                     </archive>
                 </configuration>
                 </configuration>
             </plugin>
             </plugin>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-checkstyle-plugin</artifactId>
-                <version>3.0.0</version>
-                <dependencies>
-                    <dependency>
-                        <groupId>com.puppycrawl.tools</groupId>
-                        <artifactId>checkstyle</artifactId>
-                        <version>8.11</version>
-                    </dependency>
-                </dependencies>
-                <executions>
-                    <execution>
-                        <id>validate</id>
-                        <phase>validate</phase>
-                        <configuration>
-                            <propertyExpansion>basedir=${basedir}</propertyExpansion>
-                            <configLocation>../build/checkstyle.xml</configLocation>
-                            <encoding>UTF-8</encoding>
-                            <consoleOutput>true</consoleOutput>
-                            <includeTestResources>false</includeTestResources>
-                            <failsOnError>true</failsOnError>
-                            <includes>**/*.java,**/*.jsp,**/*.properties,**/*.xml,**/*.css,**/*.svg</includes>
-                            <sourceDirectories>
-                                <directory>src/main</directory>
-                            </sourceDirectories>
-                        </configuration>
-                        <goals>
-                            <goal>check</goal>
-                        </goals>
-                    </execution>
-                </executions>
-            </plugin>
             <plugin>
             <plugin>
                 <groupId>io.leonard.maven.plugins</groupId>
                 <groupId>io.leonard.maven.plugins</groupId>
                 <artifactId>jspc-maven-plugin</artifactId>
                 <artifactId>jspc-maven-plugin</artifactId>
@@ -284,38 +246,6 @@
     </reporting>
     </reporting>
 
 
     <dependencies>
     <dependencies>
-        <!-- Test dependencies -->
-        <dependency>
-            <groupId>junit</groupId>
-            <artifactId>junit</artifactId>
-            <version>4.12</version>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.mockito</groupId>
-            <artifactId>mockito-core</artifactId>
-            <version>2.13.0</version>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.assertj</groupId>
-            <artifactId>assertj-core</artifactId>
-            <version>3.9.1</version>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>com.github.tomakehurst</groupId>
-            <artifactId>wiremock</artifactId>
-            <version>2.18.0</version>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.reflections</groupId>
-            <artifactId>reflections</artifactId>
-            <version>0.9.11</version>
-            <scope>test</scope>
-        </dependency>
-
         <!-- main jar -->
         <!-- main jar -->
         <dependency>
         <dependency>
             <groupId>${project.groupId}</groupId>
             <groupId>${project.groupId}</groupId>