<?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">

  <!-- Used for making releases. -->
  <parent>
    <artifactId>oss-parent</artifactId>
    <groupId>org.sonatype.oss</groupId>
    <version>5</version>
  </parent>
  
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.puppycrawl.tools</groupId>
  <artifactId>checkstyle</artifactId>
  <version>5.2</version>
  <packaging>jar</packaging>
  <name>checkstyle</name>
  <url>http://checkstyle.sourceforge.net/</url>
  <issueManagement>
    <system>SourceForge</system>
    <url>http://sourceforge.net/tracker/?group_id=29721</url>
  </issueManagement>
  <inceptionYear>2001</inceptionYear>

  <description>Checkstyle is a development tool to help programmers write Java code that adheres to a coding standard</description>

  <licenses>
    <license>
      <name>GNU Lesser General Public License</name>
      <url>http://www.gnu.org/licenses/lgpl.txt</url>
    </license>
  </licenses>

  <scm>
    <connection>scm:svn:https://checkstyle.svn.sourceforge.net/svnroot/checkstyle/tags/release5_2</connection>
    <developerConnection>scm:svn:https://checkstyle.svn.sourceforge.net/svnroot/checkstyle/tags/release5_2</developerConnection>
    <url>http://checkstyle.svn.sourceforge.net/viewvc/checkstyle/tags/release5_2</url>
  </scm>

  <distributionManagement>
    <site>
      <id>checkstyle-snapshot-site</id>
      <name>Snapshot Site</name>
      <url>scp://shell.sourceforge.net/home/groups/c/ch/checkstyle/htdocs/snapshot</url>
    </site>
  </distributionManagement>

  <developers>
    <developer>
      <id>oburn</id>
      <name>Oliver Burn</name>
      <roles>
        <role>founder</role>
      </roles>
    </developer>
    <developer>
      <id>lkuehne</id>
      <name>Lars Kühne</name>
      <roles>
        <role>developer</role>
      </roles>
    </developer>
    <developer>
      <id>rickgiles</id>
      <name>Rick Giles</name>
      <roles>
        <role>developer</role>
      </roles>
    </developer>
    <developer>
      <id>o_sukhodolsky</id>
      <name>Oleg Sukhodolsky</name>
      <roles>
        <role>developer</role>
      </roles>
    </developer>
    <developer>
      <id>mstudman</id>
      <name>Michael Studman</name>
      <roles>
        <role>developer</role>
      </roles>
    </developer>
    <developer>
      <id>tschneeberger</id>
      <name>Travis Schneeberger</name>
      <roles>
        <role>developer</role>
      </roles>
    </developer>
  </developers>

  <mailingLists>
    <mailingList>
      <name>checkstyle-announce</name>
      <archive>https://sourceforge.net/mailarchive/forum.php?forum_name=checkstyle-announce</archive>
      <subscribe>https://lists.sourceforge.net/mailman/listinfo/checkstyle-announce</subscribe>
      <unsubscribe>https://lists.sourceforge.net/mailman/listinfo/checkstyle-announce</unsubscribe>
    </mailingList>
    <mailingList>
      <name>checkstyle-commits</name>
      <archive>https://sourceforge.net/mailarchive/forum.php?forum_name=checkstyle-commits</archive>
      <subscribe>https://lists.sourceforge.net/mailman/listinfo/checkstyle-commits</subscribe>
      <unsubscribe>https://lists.sourceforge.net/mailman/listinfo/checkstyle-commits</unsubscribe>
    </mailingList>
    <mailingList>
      <name>checkstyle-devel</name>
      <archive>https://sourceforge.net/mailarchive/forum.php?forum_name=checkstyle-devel</archive>
      <subscribe>https://lists.sourceforge.net/mailman/listinfo/checkstyle-devel</subscribe>
      <unsubscribe>https://lists.sourceforge.net/mailman/listinfo/checkstyle-devel</unsubscribe>
    </mailingList>
    <mailingList>
      <name>checkstyle-user</name>
      <archive>https://sourceforge.net/mailarchive/forum.php?forum_name=checkstyle-user</archive>
      <subscribe>https://lists.sourceforge.net/mailman/listinfo/checkstyle-user</subscribe>
      <unsubscribe>https://lists.sourceforge.net/mailman/listinfo/checkstyle-user</unsubscribe>
    </mailingList>
  </mailingLists>

  <properties>
    <project.build.sourceEncoding>iso-8859-1</project.build.sourceEncoding>
    <testinputs.dir>${basedir}/src/testinputs/com/puppycrawl/tools/checkstyle</testinputs.dir>
    <testsrcs.dir>${basedir}/src/tests/com/puppycrawl/tools/checkstyle</testsrcs.dir>
    <projectVersion>${project.version}</projectVersion>
  </properties>

  <dependencies>
    <dependency>
      <groupId>antlr</groupId>
      <artifactId>antlr</artifactId>
      <version>2.7.7</version>
    </dependency>
    <dependency>
      <groupId>commons-beanutils</groupId>
      <artifactId>commons-beanutils-core</artifactId>
      <version>1.8.3</version>
    </dependency>
    <dependency>
      <groupId>commons-cli</groupId>
      <artifactId>commons-cli</artifactId>
      <version>1.2</version>
    </dependency>
    <dependency>
      <groupId>com.google.collections</groupId>
      <artifactId>google-collections</artifactId>
      <version>1.0</version>
    </dependency>
    <dependency>
      <groupId>org.apache.ant</groupId>
      <artifactId>ant</artifactId>
      <version>1.7.0</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>com.sun</groupId>
      <artifactId>tools</artifactId>
      <version>1.5.0</version>
      <scope>system</scope>
      <systemPath>${java.home}/../lib/tools.jar</systemPath>
    </dependency>

    <!-- test scope stuff -->
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.8.1</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <sourceDirectory>src/checkstyle</sourceDirectory>
    <resources>
      <resource>
        <directory>${basedir}/src/checkstyle</directory>
        <includes>
          <include>**/*.dtd</include>
          <include>**/*.properties</include>
          <include>**/*.xml</include>
        </includes>
      </resource>
    </resources>

    <testSourceDirectory>src/tests</testSourceDirectory>

    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
          <source>1.5</source>
          <target>1.5</target>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-site-plugin</artifactId>
        <configuration>
          <xdocDirectory>${basedir}/src/xdocs</xdocDirectory>
          <validate>true</validate>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-enforcer-plugin</artifactId>
        <executions>
          <execution>
            <id>enforce-versions</id>
            <goals>
              <goal>enforce</goal>
            </goals>
            <configuration>
              <rules>
                <requireJavaVersion>
                  <version>1.5</version>
                </requireJavaVersion>
                <requireProperty>
                  <property>java.vendor</property>
                  <regex>^Sun Microsystems Inc\.$</regex>
                </requireProperty>
              </rules>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <!-- Generate the grammar -->
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>antlr-maven-plugin</artifactId>
        <configuration>
          <sourceDirectory>${basedir}/src/checkstyle/com/puppycrawl/tools/checkstyle/grammars</sourceDirectory>
          <grammars>java.g</grammars>
        </configuration>
        <executions>
          <execution>
            <goals>
              <goal>generate</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <!-- Generate checkstylecompilation.properties -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-antrun-plugin</artifactId>
        <!-- version>1.3</version -->
        <executions>
          <execution>
            <id>ant-phase-compile</id>
            <phase>compile</phase>
            <goals>
              <goal>run</goal>
            </goals>
            <configuration>
              <tasks>
                <property name="mvn.project.build.outputDirectory" value="${project.build.outputDirectory}" />
                <property name="mvn.project.version" value="${project.version}" />
                <property name="mvn.compile_classpath" refid="maven.compile.classpath" />
                <ant antfile="ant-phase-compile.xml" />
              </tasks>
            </configuration>
          </execution>
          <execution>
            <id>ant-phase-package</id>
            <phase>prepare-package</phase>
            <goals>
              <goal>run</goal>
            </goals>
            <configuration>
              <tasks>
                <property name="mvn.project.build.directory" value="${project.build.directory}" />
                <property name="mvn.project.version" value="${project.version}" />
                <property name="mvn.runtime_classpath" refid="maven.runtime.classpath" />
                <ant antfile="ant-phase-prepare-package.xml" />
              </tasks>
            </configuration>
          </execution>
        </executions>
        <dependencies>
          <dependency>
            <groupId>org.apache.ant</groupId>
            <artifactId>ant-nodeps</artifactId>
            <version>1.7.1</version>
          </dependency>
        </dependencies>
      </plugin>

      <!-- Used to set custom properties -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <systemProperties>
            <property>
              <name>testinputs.dir</name>
              <value>${testinputs.dir}</value>
            </property>
            <property>
              <name>testsrcs.dir</name>
              <value>${testsrcs.dir}</value>
            </property>
          </systemProperties>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>exec-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>runner</id>
            <goals>
              <goal>java</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <mainClass>com.puppycrawl.tools.checkstyle.gui.Main</mainClass>
          <classpathScope>runtime</classpathScope>
        </configuration>
      </plugin>

      <!-- Ensure the manifest has all the gory details -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <configuration>
          <archive>
            <manifest>
              <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
              <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
            </manifest>
          </archive>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>cobertura-maven-plugin</artifactId>
        <configuration>
          <instrumentation>
            <excludes>
              <exclude>com/puppycrawl/tools/checkstyle/CheckStyleTask*.class</exclude>
              <exclude>com/puppycrawl/tools/checkstyle/doclets/*.class</exclude>
              <exclude>com/puppycrawl/tools/checkstyle/grammars/*.class</exclude>
              <exclude>com/puppycrawl/tools/checkstyle/gui/*.class</exclude>
            </excludes>
          </instrumentation>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-linkcheck-plugin</artifactId>
      </plugin>
    </plugins>
  </build>

  <reporting>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <configuration>
          <source>1.5</source>
        </configuration>
        <reportSets>
          <reportSet>
            <id>default</id>
            <reports>
              <report>javadoc</report>
            </reports>
          </reportSet>
        </reportSets>
      </plugin>
        <!--
        THE FOLLOWING DOES NOT WORK!
      <plugin>
      	<groupId>org.apache.maven.plugins</groupId>
      	<artifactId>maven-linkcheck-plugin</artifactId>
        <configuration>
          <excludedLinks><excludedLink>**/apidocs/**</excludedLink></excludedLinks>
        </configuration>
      </plugin>
         -->
    </plugins>
  </reporting>

  <profiles>
    <profile>
      <!-- To be used when making distributions. Run the command-->
      <!-- mvn -Pdistro package -->
      <id>distro</id>
      <build>
        <plugins>
          <!-- Generates the site, which is required for assembly -->
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-site-plugin</artifactId>
            <executions>
              <execution>
                <id>gen-site</id>
                <phase>prepare-package</phase>
                <goals>
                  <goal>site</goal>
                </goals>
              </execution>
            </executions>
          </plugin>

          <!-- Creates the all inclusive uber jar -->
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-shade-plugin</artifactId>
            <executions>
              <execution>
                <phase>package</phase>
                <goals>
                  <goal>shade</goal>
                </goals>
                <configuration>
                  <shadedArtifactAttached>true</shadedArtifactAttached>
                  <shadedClassifierName>all</shadedClassifierName>
                  <transformers>
                    <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
                      <mainClass>com.puppycrawl.tools.checkstyle.Main</mainClass>
                    </transformer>
                  </transformers>
                </configuration>
              </execution>
            </executions>
          </plugin>

          <!-- Creates the binary and source distributions -->
          <plugin>
            <artifactId>maven-assembly-plugin</artifactId>
            <configuration>
              <descriptors>
                <descriptor>config/assembly-bin.xml</descriptor>
                <descriptor>config/assembly-src.xml</descriptor>
              </descriptors>
            </configuration>
            <executions>
              <execution>
                <id>make-bundle</id>
                <phase>package</phase>
                <goals>
                  <goal>single</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>release</id>
      <distributionManagement>
        <site>
          <id>checkstyle-site</id>
          <name>Default Site</name>
          <url>scp://shell.sourceforge.net/home/groups/c/ch/checkstyle/htdocs</url>
        </site>
      </distributionManagement>
    </profile>

    <profile>
      <id>release-sign-artifacts</id>
      <activation>
        <property>
          <name>performRelease</name>
          <value>true</value>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
