Skip to content

Commit

Permalink
HSEARCH-1178 Add checkstyle plugin and configuration to check headers
Browse files Browse the repository at this point in the history
  • Loading branch information
DavideD authored and Sanne committed Nov 28, 2012
1 parent cecd51b commit 908e982
Show file tree
Hide file tree
Showing 9 changed files with 91 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
@@ -1,6 +1,9 @@
# Typically *NIX text editors, by default, append '~' to files on saving to make backups
*~

#Checkstyle
.checkstyle

# Gradle work directory
.gradle
buildSrc/.gradle
Expand Down
28 changes: 28 additions & 0 deletions hibernate-search-build-config/pom.xml
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-search-parent</artifactId>
<version>4.2.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

<artifactId>hibernate-search-build-config</artifactId>
<name>Hibernate Search Build Configuration</name>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>

</project>
12 changes: 12 additions & 0 deletions hibernate-search-build-config/src/main/resources/checkstyle.xml
@@ -0,0 +1,12 @@
<?xml version="1.0"?>
<!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.2//EN" "http://www.puppycrawl.com/dtds/configuration_1_2.dtd">

<module name="Checker">
<module name="TreeWalker">
<module name="Regexp">
<property name="format"
value="\A(/\*\n \* Hibernate, Relational Persistence for Idiomatic Java\n \*\n \* Copyright \(c\) \d{4}(-\d{4})?, Red Hat, Inc. and/or its affiliates or third-party contributors as\n \* indicated by the @author tags or express copyright attribution\n \* statements applied by the authors. All third-party contributions are\n \* distributed under license by Red Hat, Inc.\n \*\n \* This copyrighted material is made available to anyone wishing to use, modify,\n \* copy, or redistribute it subject to the terms and conditions of the GNU\n \* Lesser General Public License, as published by the Free Software Foundation.\n \*\n \* This program is distributed in the hope that it will be useful,\n \* but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY\n \* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License\n \* for more details.\n \*\n \* You should have received a copy of the GNU Lesser General Public License\n \* along with this distribution; if not, write to:\n \* Free Software Foundation, Inc.\n \* 51 Franklin Street, Fifth Floor\n \* Boston, MA 02110-1301 USA\n \*/)|(/\* ?\n \* Hibernate, Relational Persistence for Idiomatic Java\n \* ?\n \* JBoss, Home of Professional Open Source\n \* Copyright \d{4} Red Hat Inc. and/or its affiliates and other contributors\n \* as indicated by the @authors tag. All rights reserved.\n \* See the copyright.txt in the distribution for a\n \* full listing of individual contributors.\n \*\n \* This copyrighted material is made available to anyone wishing to use,\n \* modify, copy, or redistribute it subject to the terms and conditions\n \* of the GNU Lesser General Public License, v. 2.1.\n \* This program is distributed in the hope that it will be useful, but WITHOUT A\n \* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A\n \* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.\n \* You should have received a copy of the GNU Lesser General Public License,\n \* v.2.1 along with this distribution; if not, write to the Free Software\n \* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,\n \* MA 02110-1301, USA.\n \*/)|(/\*\n \* Hibernate, Relational Persistence for Idiomatic Java\n \*\n \* JBoss, Home of Professional Open Source\n \* Copyright \d{4}(-\d{4})? Red Hat Inc. and/or its affiliates and other contributors\n \* as indicated by the @authors tag. All rights reserved.\n \* See the copyright.txt in the distribution for a\n \* full listing of individual contributors.\n \*\n \* This copyrighted material is made available to anyone wishing to use,\n \* modify, copy, or redistribute it subject to the terms and conditions\n \* of the GNU Lesser General Public License, v. 2.1.\n \* This program is distributed in the hope that it will be useful, but WITHOUT A\n \* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A\n \* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.\n \* You should have received a copy of the GNU Lesser General Public License,\n \* v.2.1 along with this distribution; if not, write to the Free Software\n \* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,\n \* MA 02110-1301, USA.\n \*/)|(/\* ?\n \* JBoss, Home of Professional Open Source\n \* Copyright 2011 Red Hat Inc. and/or its affiliates and other contributors\n \* as indicated by the @authors tag. All rights reserved.\n \* See the copyright.txt in the distribution for a\n \* full listing of individual contributors.\n \*\n \* This copyrighted material is made available to anyone wishing to use,\n \* modify, copy, or redistribute it subject to the terms and conditions\n \* of the GNU Lesser General Public License, v. 2.1.\n \* This program is distributed in the hope that it will be useful, but WITHOUT A\n \* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A\n \* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.\n \* You should have received a copy of the GNU Lesser General Public License,\n \* v.2.1 along with this distribution; if not, write to the Free Software\n \* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,\n \* MA 02110-1301, USA.\n \*/)|(/\*\n \* JBoss, Home of Professional Open Source\n \* Copyright \d{4}, Red Hat Middleware LLC, and individual contributors\n \* by the @authors tag. See the copyright.txt in the distribution for a\n \* full listing of individual contributors.\n \*\n \* Licensed under the Apache License, Version 2.0 \(the .License.\);\n \* you may not use this file except in compliance with the License.\n \* You may obtain a copy of the License at\n \* http://www.apache.org/licenses/LICENSE-2.0\n \* Unless required by applicable law or agreed to in writing, software\n \* distributed under the License is distributed on an .AS IS. BASIS,\n \* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n \* See the License for the specific language governing permissions and\n \* limitations under the License.\n \*/)|(/\*\n \* JBoss, Home of Professional Open Source\n \* Copyright \d{4} Red Hat Inc. and/or its affiliates and other\n \* contributors as indicated by the @author tags. All rights reserved.\n \* See the copyright.txt in the distribution for a full listing of\n \* individual contributors.\n \*\n \* This is free software; you can redistribute it and/or modify it\n \* under the terms of the GNU Lesser General Public License as\n \* published by the Free Software Foundation; either version 2.1 of\n \* the License, or \(at your option\) any later version.\n \*\n \* This software is distributed in the hope that it will be useful,\n \* but WITHOUT ANY WARRANTY; without even the implied warranty of\n \* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n \* Lesser General Public License for more details.\n \*\n \* You should have received a copy of the GNU Lesser General Public\n \* License along with this software; if not, write to the Free\n \* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA\n \* 02110-1301 USA, or see the FSF site: http://www.fsf.org.\n \*/)|(/*\n\* Hibernate, Relational Persistence for Idiomatic Java\n\*\n\* Copyright \(c\) \d{4}, Red Hat, Inc. and/or its affiliates or third-party contributors as\n\* indicated by the @author tags or express copyright attribution\n\* statements applied by the authors. All third-party contributions are\n\* distributed under license by Red Hat, Inc.\n\*\n\* This copyrighted material is made available to anyone wishing to use, modify,\n\* copy, or redistribute it subject to the terms and conditions of the GNU\n\* Lesser General Public License, as published by the Free Software Foundation.\n\*\n\* This program is distributed in the hope that it will be useful,\n\* but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY\n\* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License\n\* for more details.\n\*\n\* You should have received a copy of the GNU Lesser General Public License\n\* along with this distribution; if not, write to:\n\* Free Software Foundation, Inc.\n\* 51 Franklin Street, Fifth Floor\n\* Boston, MA 02110-1301 USA\n\*/)|(/\* \n \* Hibernate, Relational Persistence for Idiomatic Java\n \* \n \* JBoss, Home of Professional Open Source\n \* Copyright \d{4} Red Hat Inc. and/or its affiliates and other contributors\n \* as indicated by the @authors tag. All rights reserved.\n \* See the copyright.txt in the distribution for a\n \* full listing of individual contributors.\n \*\n \* This copyrighted material is made available to anyone wishing to use,\n \* modify, copy, or redistribute it subject to the terms and conditions\n \* of the GNU Lesser General Public License, v. 2.1.\n \* This program is distributed in the hope that it will be useful, but WITHOUT A\n \* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A\n \* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.\n \* You should have received a copy of the GNU Lesser General Public License,\n \* v.2.1 along with this distribution; if not, write to the Free Software\n \* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,\n \* MA 02110-1301, USA.\n \*/)|(/\*\n \* Hibernate, Relational Persistence for Idiomatic Java\n \*\n \* Copyright \(c\) \d{4}, Red Hat Inc. or third-party contributors as\n \* indicated by the @author tags or express copyright attribution\n \* statements applied by the authors. All third-party contributions are\n \* distributed under license by Red Hat Inc.\n \*\n \* This copyrighted material is made available to anyone wishing to use, modify,\n \* copy, or redistribute it subject to the terms and conditions of the GNU\n \* Lesser General Public License, as published by the Free Software Foundation.\n \*\n \* This program is distributed in the hope that it will be useful,\n \* but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY\n \* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License\n \* for more details.\n \*\n \* You should have received a copy of the GNU Lesser General Public License\n \* along with this distribution; if not, write to:\n \* Free Software Foundation, Inc.\n \* 51 Franklin Street, Fifth Floor\n \* Boston, MA 02110-1301 USA\n \*/)" />
<property name="message" value="Correct header not found" />
</module>
</module>
</module>
4 changes: 4 additions & 0 deletions hibernate-search-engine/pom.xml
Expand Up @@ -182,6 +182,10 @@
</additionalClasspathElements>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.bsc.maven</groupId>
<artifactId>maven-processor-plugin</artifactId>
Expand Down
4 changes: 4 additions & 0 deletions hibernate-search-infinispan/pom.xml
Expand Up @@ -99,6 +99,10 @@
</testResource>
</testResources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
Expand Down
4 changes: 4 additions & 0 deletions hibernate-search-integrationtest/pom.xml
Expand Up @@ -52,6 +52,10 @@
</testResource>
</testResources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
Expand Down
4 changes: 4 additions & 0 deletions hibernate-search-orm/pom.xml
Expand Up @@ -151,6 +151,10 @@
</testResource>
</testResources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
Expand Down
4 changes: 4 additions & 0 deletions hibernate-search-testing/pom.xml
Expand Up @@ -75,6 +75,10 @@
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
Expand Down
28 changes: 28 additions & 0 deletions pom.xml
Expand Up @@ -38,6 +38,7 @@

<modules>
<module>hibernate-search</module>
<module>hibernate-search-build-config</module>
<module>hibernate-search-engine</module>
<module>hibernate-search-orm</module>
<module>hibernate-search-analyzers</module>
Expand Down Expand Up @@ -794,6 +795,33 @@
<artifactId>maven-help-plugin</artifactId>
<version>2.1.1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>2.9.1</version>
<configuration>
<configLocation>checkstyle.xml</configLocation>
<consoleOutput>true</consoleOutput>
<failsOnError>true</failsOnError>
<violationSeverity>error</violationSeverity>
</configuration>
<executions>
<execution>
<id>check-style</id>
<phase>compile</phase>
<goals>
<goal>checkstyle</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>hibernate-search-build-config</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<!-- This plugin's configuration is used in m2e only. -->
<groupId>org.eclipse.m2e</groupId>
Expand Down

0 comments on commit 908e982

Please sign in to comment.