<commit_before><?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/maven-v4_0_0.xsd">

    <modelVersion>4.0.0</modelVersion>

    <groupId>com.psddev</groupId>
    <artifactId>dari-grandparent</artifactId>
    <version>3.0-SNAPSHOT</version>
    <packaging>pom</packaging>

    <name>Dari: Grandparent POM</name>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-clean-plugin</artifactId>
                <version>2.4.1</version>
                <configuration>
                    <filesets>

                        <!-- Clean up after war:inplace goal. -->
                        <fileset>
                            <directory>src/main/webapp/WEB-INF</directory>
                            <includes>
                                <include>classes/**</include>
                                <include>lib/**</include>
                            </includes>
                        </fileset>
                    </filesets>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>2.3.2</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                    <showDeprecation>true</showDeprecation>
                    <showWarnings>true</showWarnings>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>2.3.1</version>
                <configuration>
                    <archive>
                        <manifestEntries>
                            <Dari-ClassFinder-Include>true</Dari-ClassFinder-Include>
                            <Dari-SourceFilter-JavaSources>${project.build.sourceDirectory}</Dari-SourceFilter-JavaSources>
                            <Dari-SourceFilter-WebappSources>${basedir}/src/main/webapp</Dari-SourceFilter-WebappSources>
                        </manifestEntries>
                    </archive>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
                <version>2.6</version>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <version>2.1.1</version>
                <configuration>
                    <archive>
                        <manifestEntries>
                            <Dari-ClassFinder-Include>true</Dari-ClassFinder-Include>
                            <Dari-SourceFilter-JavaSources>${project.build.sourceDirectory}</Dari-SourceFilter-JavaSources>
                            <Dari-SourceFilter-WebappSources>${basedir}/src/main/webapp</Dari-SourceFilter-WebappSources>
                        </manifestEntries>
                    </archive>

                    <!--
                    Remove version number when copying the JARs to the WAR
                    to reduce possible conflicts during development.
                    -->
                    <outputFileNameMapping>@{artifactId}@@{dashClassifier?}@.@{extension}@</outputFileNameMapping>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.codehaus.groovy.maven</groupId>
                <artifactId>gmaven-plugin</artifactId>
                <version>1.0</version>
                <executions>
                    <execution>
                        <id>create-build-properties</id>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>execute</goal>
                        </goals>
                        <configuration>
                            <source><![CDATA[
import java.io.*
import java.util.*

def packaging = project.packaging
if (!(packaging == 'jar' || packaging == 'war')) {
    return
}

def buildFile = 'build.properties'
def env = System.getenv()
try {
    def map = new HashMap<String, String>()
    log.info("Generating ${buildFile} file.")

    map['name'] = project.name
    map['version'] = project.version
    map['buildDate'] = '' + new Date()

    def im = project.issueManagement
    if (im) {
        map['issueManagementSystem'] = im.system
        map['issueManagementUrl'] = im.url
    }

    def scm = project.scm
    if (scm) {
        map['scmConnection'] = scm.connection
        map['scmDeveloperConnection'] = scm.developerConnection
        map['scmUrl'] = scm.url
    }

    map['classFinder.include'] = 'true'
    map['javaSourceDirectory'] = project.build.sourceDirectory
    map['resourceDirectory'] = new File(pom.basedir, [ 'src', 'main', 'resources' ].join(File.separator)).getPath()
    map['webappSourceDirectory'] = new File(pom.basedir, [ 'src', 'main', 'webapp' ].join(File.separator)).getPath()

    map['sourceFilter.javaSources'] = project.build.sourceDirectory
    map['sourceFilter.webappSources'] = new File(pom.basedir, [ 'src', 'main', 'webapp' ].join(File.separator)).getPath()

    def properties = new Properties()
    map.each { key, value ->
        if (value) {
            properties[key] = value
            log.info("Property: ${key}=${value}")
        }
    }

    if (env.BUILD_NUMBER) {
        properties['buildNumber'] = env.BUILD_NUMBER

        try {
            def git = 'git'
            if (env['OS'] =~ /^Windows/) {
                git = "cmd /c ${git}"
            }
            properties['gitCommits'] = [ git, 'log', '-n 500', '--format=%H~|~%an~|~%at~|~%d~|~%s~|~%b~-~' ].execute().in.text
        } catch (Exception ex) {
            log.warn('Git not available!', ex)
        }
    }

    def outputDirectory = new File(project.build.outputDirectory)
    outputDirectory.mkdirs()
    new File(outputDirectory, buildFile).withOutputStream { output ->
        properties.store(output, null)
    }

} catch (Exception ex) {
    log.warn("Failed to generate ${buildFile} file!", ex)
}
                            ]]></source>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>jspc-maven-plugin</artifactId>
                <version>1.4.6</version>
                <configuration>
                    <source>1.5</source>
                    <target>1.5</target>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>tomcat-maven-plugin</artifactId>
                <version>1.0</version>
                <configuration>
                    <url>${tomcat.url}</url>
                    <path>${tomcat.path}</path>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>2.9.1</version>
                <configuration>
                    <additionalparam>-Xdoclint:none</additionalparam>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>prepare-release</id>

            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.groovy.maven</groupId>
                        <artifactId>gmaven-plugin</artifactId>
                        <version>1.0</version>
                        <executions>
                            <execution>
                                <id>generate-release-version</id>
                                <phase>initialize</phase>
                                <goals>
                                    <goal>execute</goal>
                                </goals>
                                <configuration>
                                    <source><![CDATA[
import java.util.*

try {
    def git = 'git'

    if (System.getenv()['OS'] =~ /^Windows/) {
        git = "cmd /c ${git}"
    }

    def newVersion = project.version.toString().replace('-SNAPSHOT', '') +
            '.' + ([ git, 'rev-list', '--count', 'HEAD' ].execute().in.text.trim()) +
            '-' + ([ git, 'rev-parse', 'HEAD' ].execute().in.text.trim().substring(0, 6))

    project.properties['newVersion'] = newVersion
    project.properties['generateBackupPoms'] = 'false'
    log.info("Set newVersion to ${newVersion}.")

} catch (Exception error) {
    log.warn('Git not available!', error)
}
                                    ]]></source>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>

                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>versions-maven-plugin</artifactId>
                        <version>2.1</version>
                        <executions>
                            <execution>
                                <id>set-release-version</id>
                                <phase>initialize</phase>
                                <goals>
                                    <goal>set</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>run-grunt</id>

            <activation>
                <file>
                    <exists>Gruntfile.js</exists>
                </file>
            </activation>

            <build>
                <plugins>
                    <plugin>
                        <groupId>com.github.eirslett</groupId>
                        <artifactId>frontend-maven-plugin</artifactId>
                        <version>0.0.14</version>

                        <executions>
                            <execution>
                                <id>install-node-and-npm</id>
                                <phase>generate-resources</phase>
                                <goals>
                                    <goal>install-node-and-npm</goal>
                                </goals>
                                <configuration>
                                    <nodeVersion>v0.10.26</nodeVersion>
                                    <npmVersion>1.4.7</npmVersion>
                                </configuration>
                            </execution>

                            <execution>
                                <id>npm</id>
                                <goals>
                                    <goal>npm</goal>
                                </goals>
                            </execution>

                            <execution>
                                <id>grunt</id>
                                <phase>generate-resources</phase>
                                <goals>
                                    <goal>grunt</goal>
                                </goals>
                                <configuration>
                                    <arguments>
                                        --bsp-maven-build-finalName=${project.build.finalName}
                                    </arguments>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>library</id>

            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-checkstyle-plugin</artifactId>
                        <version>2.12</version>
                        <dependencies>
                            <dependency>
                                <groupId>com.puppycrawl.tools</groupId>
                                <artifactId>checkstyle</artifactId>
                                <version>5.9</version>
                            </dependency>
                        </dependencies>
                        <executions>
                            <execution>
                                <id>verify-style</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>check</goal>
                                </goals>
                                <configuration>
                                    <checkstyleRules>
                                        <module name="Checker">
                                            <module name="FileTabCharacter"/>
                                            <module name="NewlineAtEndOfFile"/>

                                            <module name="RegexpSingleline">
                                               <property name="format" value="\s+$"/>
                                               <property name="maximum" value="0"/>
                                               <property name="message" value="Line has trailing spaces."/>
                                               <property name="minimum" value="0"/>
                                            </module>

                                            <module name="RegexpMultiline">
                                                <property name="format" value="[^\n]+\n{3,}" />
                                                <property name="message" value="Two or more consecutive empty lines." />
                                            </module>

                                            <module name="SuppressionCommentFilter"/>
                                            <module name="Translation"/>

                                            <module name="TreeWalker">
                                                <module name="ArrayTypeStyle"/>

                                                <module name="AvoidNestedBlocks">
                                                    <property name="allowInSwitchCase" value="true"/>
                                                </module>

                                                <module name="AvoidStarImport"/>
                                                <module name="ConstantName"/>

                                                <module name="EmptyBlock">
                                                    <property name="option" value="text"/>
                                                </module>

                                                <module name="EmptyForIteratorPad"/>
                                                <module name="EmptyStatement"/>
                                                <module name="EqualsHashCode"/>
                                                <module name="FileContentsHolder"/>
                                                <module name="FinalClass"/>
                                                <module name="GenericWhitespace"/>
                                                <module name="IllegalImport"/>
                                                <module name="IllegalInstantiation"/>
                                                <module name="LeftCurly"/>
                                                <module name="LocalFinalVariableName"/>
                                                <module name="LocalVariableName"/>
                                                <module name="MemberName"/><commit_msg>Removes AvoidNestedBlocks checkstyle rule.<commit_after><?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/maven-v4_0_0.xsd">

    <modelVersion>4.0.0</modelVersion>

    <groupId>com.psddev</groupId>
    <artifactId>dari-grandparent</artifactId>
    <version>3.0-SNAPSHOT</version>
    <packaging>pom</packaging>

    <name>Dari: Grandparent POM</name>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-clean-plugin</artifactId>
                <version>2.4.1</version>
                <configuration>
                    <filesets>

                        <!-- Clean up after war:inplace goal. -->
                        <fileset>
                            <directory>src/main/webapp/WEB-INF</directory>
                            <includes>
                                <include>classes/**</include>
                                <include>lib/**</include>
                            </includes>
                        </fileset>
                    </filesets>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>2.3.2</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                    <showDeprecation>true</showDeprecation>
                    <showWarnings>true</showWarnings>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>2.3.1</version>
                <configuration>
                    <archive>
                        <manifestEntries>
                            <Dari-ClassFinder-Include>true</Dari-ClassFinder-Include>
                            <Dari-SourceFilter-JavaSources>${project.build.sourceDirectory}</Dari-SourceFilter-JavaSources>
                            <Dari-SourceFilter-WebappSources>${basedir}/src/main/webapp</Dari-SourceFilter-WebappSources>
                        </manifestEntries>
                    </archive>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
                <version>2.6</version>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <version>2.1.1</version>
                <configuration>
                    <archive>
                        <manifestEntries>
                            <Dari-ClassFinder-Include>true</Dari-ClassFinder-Include>
                            <Dari-SourceFilter-JavaSources>${project.build.sourceDirectory}</Dari-SourceFilter-JavaSources>
                            <Dari-SourceFilter-WebappSources>${basedir}/src/main/webapp</Dari-SourceFilter-WebappSources>
                        </manifestEntries>
                    </archive>

                    <!--
                    Remove version number when copying the JARs to the WAR
                    to reduce possible conflicts during development.
                    -->
                    <outputFileNameMapping>@{artifactId}@@{dashClassifier?}@.@{extension}@</outputFileNameMapping>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.codehaus.groovy.maven</groupId>
                <artifactId>gmaven-plugin</artifactId>
                <version>1.0</version>
                <executions>
                    <execution>
                        <id>create-build-properties</id>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>execute</goal>
                        </goals>
                        <configuration>
                            <source><![CDATA[
import java.io.*
import java.util.*

def packaging = project.packaging
if (!(packaging == 'jar' || packaging == 'war')) {
    return
}

def buildFile = 'build.properties'
def env = System.getenv()
try {
    def map = new HashMap<String, String>()
    log.info("Generating ${buildFile} file.")

    map['name'] = project.name
    map['version'] = project.version
    map['buildDate'] = '' + new Date()

    def im = project.issueManagement
    if (im) {
        map['issueManagementSystem'] = im.system
        map['issueManagementUrl'] = im.url
    }

    def scm = project.scm
    if (scm) {
        map['scmConnection'] = scm.connection
        map['scmDeveloperConnection'] = scm.developerConnection
        map['scmUrl'] = scm.url
    }

    map['classFinder.include'] = 'true'
    map['javaSourceDirectory'] = project.build.sourceDirectory
    map['resourceDirectory'] = new File(pom.basedir, [ 'src', 'main', 'resources' ].join(File.separator)).getPath()
    map['webappSourceDirectory'] = new File(pom.basedir, [ 'src', 'main', 'webapp' ].join(File.separator)).getPath()

    map['sourceFilter.javaSources'] = project.build.sourceDirectory
    map['sourceFilter.webappSources'] = new File(pom.basedir, [ 'src', 'main', 'webapp' ].join(File.separator)).getPath()

    def properties = new Properties()
    map.each { key, value ->
        if (value) {
            properties[key] = value
            log.info("Property: ${key}=${value}")
        }
    }

    if (env.BUILD_NUMBER) {
        properties['buildNumber'] = env.BUILD_NUMBER

        try {
            def git = 'git'
            if (env['OS'] =~ /^Windows/) {
                git = "cmd /c ${git}"
            }
            properties['gitCommits'] = [ git, 'log', '-n 500', '--format=%H~|~%an~|~%at~|~%d~|~%s~|~%b~-~' ].execute().in.text
        } catch (Exception ex) {
            log.warn('Git not available!', ex)
        }
    }

    def outputDirectory = new File(project.build.outputDirectory)
    outputDirectory.mkdirs()
    new File(outputDirectory, buildFile).withOutputStream { output ->
        properties.store(output, null)
    }

} catch (Exception ex) {
    log.warn("Failed to generate ${buildFile} file!", ex)
}
                            ]]></source>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>jspc-maven-plugin</artifactId>
                <version>1.4.6</version>
                <configuration>
                    <source>1.5</source>
                    <target>1.5</target>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>tomcat-maven-plugin</artifactId>
                <version>1.0</version>
                <configuration>
                    <url>${tomcat.url}</url>
                    <path>${tomcat.path}</path>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>2.9.1</version>
                <configuration>
                    <additionalparam>-Xdoclint:none</additionalparam>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>prepare-release</id>

            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.groovy.maven</groupId>
                        <artifactId>gmaven-plugin</artifactId>
                        <version>1.0</version>
                        <executions>
                            <execution>
                                <id>generate-release-version</id>
                                <phase>initialize</phase>
                                <goals>
                                    <goal>execute</goal>
                                </goals>
                                <configuration>
                                    <source><![CDATA[
import java.util.*

try {
    def git = 'git'

    if (System.getenv()['OS'] =~ /^Windows/) {
        git = "cmd /c ${git}"
    }

    def newVersion = project.version.toString().replace('-SNAPSHOT', '') +
            '.' + ([ git, 'rev-list', '--count', 'HEAD' ].execute().in.text.trim()) +
            '-' + ([ git, 'rev-parse', 'HEAD' ].execute().in.text.trim().substring(0, 6))

    project.properties['newVersion'] = newVersion
    project.properties['generateBackupPoms'] = 'false'
    log.info("Set newVersion to ${newVersion}.")

} catch (Exception error) {
    log.warn('Git not available!', error)
}
                                    ]]></source>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>

                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>versions-maven-plugin</artifactId>
                        <version>2.1</version>
                        <executions>
                            <execution>
                                <id>set-release-version</id>
                                <phase>initialize</phase>
                                <goals>
                                    <goal>set</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>run-grunt</id>

            <activation>
                <file>
                    <exists>Gruntfile.js</exists>
                </file>
            </activation>

            <build>
                <plugins>
                    <plugin>
                        <groupId>com.github.eirslett</groupId>
                        <artifactId>frontend-maven-plugin</artifactId>
                        <version>0.0.14</version>

                        <executions>
                            <execution>
                                <id>install-node-and-npm</id>
                                <phase>generate-resources</phase>
                                <goals>
                                    <goal>install-node-and-npm</goal>
                                </goals>
                                <configuration>
                                    <nodeVersion>v0.10.26</nodeVersion>
                                    <npmVersion>1.4.7</npmVersion>
                                </configuration>
                            </execution>

                            <execution>
                                <id>npm</id>
                                <goals>
                                    <goal>npm</goal>
                                </goals>
                            </execution>

                            <execution>
                                <id>grunt</id>
                                <phase>generate-resources</phase>
                                <goals>
                                    <goal>grunt</goal>
                                </goals>
                                <configuration>
                                    <arguments>
                                        --bsp-maven-build-finalName=${project.build.finalName}
                                    </arguments>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>library</id>

            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-checkstyle-plugin</artifactId>
                        <version>2.12</version>
                        <dependencies>
                            <dependency>
                                <groupId>com.puppycrawl.tools</groupId>
                                <artifactId>checkstyle</artifactId>
                                <version>5.9</version>
                            </dependency>
                        </dependencies>
                        <executions>
                            <execution>
                                <id>verify-style</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>check</goal>
                                </goals>
                                <configuration>
                                    <checkstyleRules>
                                        <module name="Checker">
                                            <module name="FileTabCharacter"/>
                                            <module name="NewlineAtEndOfFile"/>

                                            <module name="RegexpSingleline">
                                               <property name="format" value="\s+$"/>
                                               <property name="maximum" value="0"/>
                                               <property name="message" value="Line has trailing spaces."/>
                                               <property name="minimum" value="0"/>
                                            </module>

                                            <module name="RegexpMultiline">
                                                <property name="format" value="[^\n]+\n{3,}" />
                                                <property name="message" value="Two or more consecutive empty lines." />
                                            </module>

                                            <module name="SuppressionCommentFilter"/>
                                            <module name="Translation"/>

                                            <module name="TreeWalker">
                                                <module name="ArrayTypeStyle"/>
                                                <module name="AvoidStarImport"/>
                                                <module name="ConstantName"/>

                                                <module name="EmptyBlock">
                                                    <property name="option" value="text"/>
                                                </module>

                                                <module name="EmptyForIteratorPad"/>
                                                <module name="EmptyStatement"/>
                                                <module name="EqualsHashCode"/>
                                                <module name="FileContentsHolder"/>
                                                <module name="FinalClass"/>
                                                <module name="GenericWhitespace"/>
                                                <module name="IllegalImport"/>
                                                <module name="IllegalInstantiation"/>
                                                <module name="LeftCurly"/>
                                                <module name="LocalFinalVariableName"/>
                                                <module name="LocalVariableName"/>
                                                <module name="MemberName"/>
{'fraction_non_alphanumeric': 0.11391032196089368, 'fraction_numerical': 0.005143937281150259, 'mean_word_length': 0.9715315535463376, 'pattern_counts': {'":': 0, '<': 726, '<?xml version=': 2, '>': 730, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 6}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 170, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7178057', 'n_tokens_mistral': 7766, 'n_tokens_neox': 6965, 'n_words': 1054}