<?xml version="1.0"?>

<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>de.smartics.rules</groupId>
  <artifactId>smartics-enforcer-rules</artifactId>
  <version>1.0.2</version>

  <name>smartics Enforcer Rules for Maven</name>
  <description>
    A collection of rules for the Maven Enforcer Plugin.
  </description>
  <url>${weburl}</url>
  <inceptionYear>2011</inceptionYear>
  <organization>
    <name>smartics</name>
    <url>http://www.smartics.de/</url>
  </organization>
  <licenses>
    <license>
      <name>The Apache Software License, Version 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0</url>
      <distribution>repo</distribution>
      <comments>
        Copyright 2011-2016 smartics, Kronseder &amp; Reiner GmbH

         Licensed 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.
      </comments>
    </license>
  </licenses>

  <developers>
    <developer>
      <id>robert.reiner</id>
      <name>Robert Reiner</name>
      <url>https://www.smartics.de/go/robertreiner</url>
      <organization>Kronseder &amp; Reiner GmbH, smartics</organization>
      <organizationUrl>http://www.smartics.de/</organizationUrl>
    </developer>
    <developer>
      <id>anton.kronseder</id>
      <name>Anton Kronseder</name>
      <url>https://www.smartics.de/go/antonkronseder</url>
      <organization>Kronseder &amp; Reiner GmbH, smartics</organization>
      <organizationUrl>http://www.smartics.de/</organizationUrl>
    </developer>
  </developers>
  <contributors>
    <contributor>
      <name>barthel</name>
      <url>https://github.com/barthel</url>
    </contributor>
  </contributors>

  <scm>
    <connection>scm:git:git@github.com:smartics/${project.artifactId}</connection>
    <developerConnection>scm:git:git@github.com:smartics/${project.artifactId}</developerConnection>
    <url>https://github.com/smartics/${project.artifactId}</url>
    <tag>smartics-enforcer-rules-1.0.2</tag>
  </scm>
  <issueManagement>
    <system>jira</system>
    <url>https://www.smartics.eu/jira/projects/SERFM</url>
  </issueManagement>

  <distributionManagement>
    <snapshotRepository>
      <id>ossrh</id>
      <url>https://oss.sonatype.org/content/repositories/snapshots</url>
    </snapshotRepository>
    <repository>
      <id>ossrh</id>
      <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
    </repository>
    <site>
      <id>${info.project.visibility}-site</id>
      <name>documentation site</name>
      <url>${build.server.site.upload}/${project.groupId}/${project.artifactId}/${project.version}</url>
    </site>
  </distributionManagement>

  <properties>
    <donationId>ZNFSBTAQJ49HA</donationId>
    <twitterId>smartics</twitterId>

    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

    <info.project.visibility>public</info.project.visibility>

    <info.server.web>https://www.smartics.eu/confluence/display</info.server.web>
    <homepage>${info.server.web}/SERFM</homepage>
    <info.server.issues>https://www.smartics.eu/jira/projects</info.server.issues>
    <info.server.repo>https://www.smartics.eu/nexus</info.server.repo>
    <info.server.scm>https://github.com/smartics/${project.artifactId}</info.server.scm>
    <info.server.site>https://www.smartics.eu</info.server.site>

    <info.server.repo.prefix>${info.server.repo}/content</info.server.repo.prefix>
    <info.server.repo.group>${info.server.repo.prefix}/groups/public-group</info.server.repo.group>

    <build.server.site.upload>scp://www.smartics.eu/home/smartics/public_html/${info.project.visibility}</build.server.site.upload>
    <build.server.repo.upload>dav:${info.server.repo.prefix}/repositories</build.server.repo.upload>

    <!-- ... projectdoc configuration ...................................... -->

    <url-nexus>https://oss.sonatype.org</url-nexus>
    <nexus-default-repo-id>releases</nexus-default-repo-id>

    <!-- ... Properties are accessible from site documentation and therefore contain no dots. -->
    <webroot>${info.server.site}</webroot>
    <weburl>${info.server.site}/${project.groupId}/${project.artifactId}/${project.version}</weburl>
    <webroot-projects>http://www.smartics.de/projects</webroot-projects>

    <maven-fluido-smartics-skin_version>2.1.0</maven-fluido-smartics-skin_version>

    <version.buildmetadata-maven-plugin>1.6.1</version.buildmetadata-maven-plugin>

    <version.maven-source-plugin>2.4</version.maven-source-plugin>
    <maven-clean-plugin.version>2.5</maven-clean-plugin.version>
    <maven-dependency-plugin.version>2.8</maven-dependency-plugin.version>
    <maven-resources-plugin.version>2.6</maven-resources-plugin.version>
    <version.maven-deploy-plugin>2.8</version.maven-deploy-plugin>
    <version.maven-jar-plugin>2.4</version.maven-jar-plugin>
    <version.maven-release-plugin>2.5.2</version.maven-release-plugin>
    <maven-install-plugin.version>2.5</maven-install-plugin.version>
    <maven-scm-plugin.version>1.8.1</maven-scm-plugin.version>
    <maven-project-info-reports-plugin.version>2.7</maven-project-info-reports-plugin.version>
    <versions-maven-plugin.version>2.1</versions-maven-plugin.version>
    <maven-site-plugin.version>3.3</maven-site-plugin.version>
    <maven-license-plugin.version>1.9.0</maven-license-plugin.version>
    <version.maven-javadoc-plugin>2.10.3</version.maven-javadoc-plugin>

    <maven-surefire-plugin.version>2.16</maven-surefire-plugin.version>
    <!--
      ->maven-compiler-plugin v3.0<- Problems may be encountered using javax.tools.JavaCompiler instead of javac. See: http://www.mail-archive.com/users@maven.apache.org/msg127903.html In this case try: <forceJavacCompilerUse>true</forceJavacCompilerUse>
      or set version back to 2.5.1.
     -->
    <maven-compiler-plugin.version>3.1</maven-compiler-plugin.version>
    <version.maven-gpg-plugin>1.6</version.maven-gpg-plugin>
    <version.wagon-webdav>1.0-beta-2</version.wagon-webdav>

    <maven.version>2.2.1</maven.version>
    <version.enforcer-api>1.4.1</version.enforcer-api>
    <maven-enforcer-plugin.version>1.4.1</maven-enforcer-plugin.version>
    <version.jdepend>2.9.1</version.jdepend>
    <plexus-container-default>1.6</plexus-container-default>
    <junit_version>4.8.2</junit_version>
  </properties>

  <dependencies>
    <!-- ... Maven ...................................................... -->

    <dependency>
      <groupId>org.apache.maven.enforcer</groupId>
      <artifactId>enforcer-api</artifactId>
      <version>${version.enforcer-api}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-project</artifactId>
      <version>${maven.version}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-core</artifactId>
      <version>${maven.version}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-artifact</artifactId>
      <version>${maven.version}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-plugin-api</artifactId>
      <version>${maven.version}</version>
    </dependency>
    <dependency>
      <groupId>org.codehaus.plexus</groupId>
      <artifactId>plexus-container-default</artifactId>
      <version>${plexus-container-default}</version>
    </dependency>
    <dependency>
      <groupId>jdepend</groupId>
      <artifactId>jdepend</artifactId>
      <version>${version.jdepend}</version>
    </dependency>

    <!-- ... test ....................................................... -->

    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>${junit_version}</version>
    </dependency>
  </dependencies>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>${maven-compiler-plugin.version}</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-clean-plugin</artifactId>
          <version>${maven-clean-plugin.version}</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-dependency-plugin</artifactId>
          <version>${maven-dependency-plugin.version}</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-resources-plugin</artifactId>
          <version>${maven-resources-plugin.version}</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-deploy-plugin</artifactId>
          <version>${version.maven-deploy-plugin}</version>
          <dependencies>
            <dependency>
              <groupId>org.apache.maven.wagon</groupId>
              <artifactId>wagon-webdav</artifactId>
              <version>${version.wagon-webdav}</version>
            </dependency>
          </dependencies>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-source-plugin</artifactId>
          <version>${maven-source-plugin.version}</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-jar-plugin</artifactId>
          <version>${version.maven-jar-plugin}</version>
          <configuration>
            <index>true</index>
            <archive>
              <manifest>
                <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
              </manifest>
              <manifestEntries>
                <Implementation-SCM-Revision-Number>${build.scmRevision.id}</Implementation-SCM-Revision-Number>
                <Implementation-SCM-Revision-Date>${build.scmRevision.date}</Implementation-SCM-Revision-Date>
                <Implementation-URL>${project.url}</Implementation-URL>
                <Implementation-Date>${build.date}</Implementation-Date>
                <Implementation-Timestamp>${build.timestamp.millis}</Implementation-Timestamp>
                <Implementation-DatePattern>${build.date.pattern}</Implementation-DatePattern>
                <Implementation-Full-Version>${build.version.full}</Implementation-Full-Version>
                <Built-OS>${os.name} / ${os.arch} / ${os.version}</Built-OS>
                <Built-By>${build.user}</Built-By>
                <Maven-Version>${build.maven.version}</Maven-Version>
                <Java-Version>${java.version}</Java-Version>
                <Java-Vendor>${java.vendor}</Java-Vendor>
              </manifestEntries>
            </archive>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-install-plugin</artifactId>
          <version>${maven-install-plugin.version}</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-release-plugin</artifactId>
          <version>${version.maven-release-plugin}</version>
          <configuration>
            <useReleaseProfile>false</useReleaseProfile>
            <releaseProfiles>release</releaseProfiles>
            <goals>deploy site-deploy</goals>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-scm-plugin</artifactId>
          <version>${maven-scm-plugin.version}</version>
          <configuration>
            <connectionType>developerConnection</connectionType>
          </configuration>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-project-info-reports-plugin</artifactId>
          <version>${maven-project-info-reports-plugin.version}</version>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-site-plugin</artifactId>
          <version>${maven-site-plugin.version}</version>
          <inherited>true</inherited>
          <dependencies>
            <dependency>
              <!-- add support for ssh/scp -->
              <groupId>org.apache.maven.wagon</groupId>
              <artifactId>wagon-ssh</artifactId>
              <version>1.0</version>
            </dependency>
          </dependencies>
          <configuration>
            <locales>en</locales>
            <relativizeDecorationLinks>false</relativizeDecorationLinks>
            <reportPlugins>
              <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-project-info-reports-plugin</artifactId>
                <reportSets>
                  <reportSet>
                    <reports>
                      <report>cim</report>
                      <report>dependencies</report>
                      <report>dependency-convergence</report>
                      <report>dependency-management</report>
                      <!-- <report>distribution-management</report> -->
                      <report>index</report>
                      <report>issue-tracking</report>
                      <report>license</report>
                      <!-- <report>mailing-list</report> -->
                      <report>modules</report>
                      <report>plugin-management</report>
                      <report>project-team</report>
                      <report>scm</report>
                      <report>summary</report>
                    </reports>
                  </reportSet>
                </reportSets>
              </plugin>
            </reportPlugins>
          </configuration>
        </plugin>
        <plugin>
          <groupId>de.smartics.maven.plugin</groupId>
          <artifactId>buildmetadata-maven-plugin</artifactId>
          <version>${version.buildmetadata-maven-plugin}</version>
          <executions>
            <execution>
              <phase>initialize</phase>
              <goals>
                <goal>provide-buildmetadata</goal>
              </goals>
            </execution>
          </executions>
          <configuration>
            <buildDatePattern>dd.MM.yyyy HH:mm:ss</buildDatePattern>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.eclipse.m2e</groupId>
          <artifactId>lifecycle-mapping</artifactId>
          <version>1.0.0</version>
          <configuration>
            <lifecycleMappingMetadata>
              <pluginExecutions>
                <pluginExecution>
                  <pluginExecutionFilter>
                    <groupId>de.smartics.maven.plugin</groupId>
                    <artifactId>buildmetadata-maven-plugin</artifactId>
                    <versionRange>[0.0.0,)</versionRange>
                    <goals>
                      <goal>provide-buildmetadata</goal>
                    </goals>
                  </pluginExecutionFilter>
                  <action>
                    <ignore />
                  </action>
                </pluginExecution>
                <pluginExecution>
                  <pluginExecutionFilter>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-enforcer-plugin</artifactId>
                    <versionRange>[1.0,)</versionRange>
                    <goals>
                      <goal>enforce</goal>
                    </goals>
                  </pluginExecutionFilter>
                  <action>
                    <ignore />
                  </action>
                </pluginExecution>
              </pluginExecutions>
            </lifecycleMappingMetadata>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>

    <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>de.smartics.maven.plugin</groupId>
        <artifactId>buildmetadata-maven-plugin</artifactId>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>${maven-surefire-plugin.version}</version>
        <configuration>
          <redirectTestOutputToFile>true</redirectTestOutputToFile>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-site-plugin</artifactId>
        <configuration>
          <reportPlugins>
            <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-project-info-reports-plugin</artifactId>
            </plugin>
            <plugin>
              <groupId>de.smartics.maven.plugin</groupId>
              <artifactId>buildmetadata-maven-plugin</artifactId>
            </plugin>
          </reportPlugins>
        </configuration>
      </plugin>

      <plugin>
        <groupId>com.mycila.maven-license-plugin</groupId>
        <artifactId>maven-license-plugin</artifactId>
        <version>${maven-license-plugin.version}</version>
        <executions>
          <execution>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <strictCheck>true</strictCheck>
          <header>src/etc/header.txt</header>
          <headerDefinitions>
            <headerDefinition>src/etc/javadoc.xml</headerDefinition>
          </headerDefinitions>
          <properties>
            <year>${build.copyright.year}</year>
          </properties>
          <excludes>
            <exclude>**/.externalToolBuilders/**</exclude>
            <exclude>**/.factorypath</exclude>
            <exclude>**/.apt_generated/**</exclude>
            <exclude>**/.fbprefs</exclude>
            <exclude>**/.pmd</exclude>
            <exclude>**/.checkstyle</exclude>
            <exclude>**/.ruleset</exclude>
            <exclude>**/COPYRIGHT.txt</exclude>
            <exclude>**/LICENSE.txt</exclude>
            <exclude>**/LICENSE-*</exclude>
            <exclude>**/*.xcf</exclude>
            <exclude>**/*.uml</exclude>
            <exclude>**/*.umlusc</exclude>
            <exclude>**/javadoc.xml</exclude>
            <exclude>**/header.txt</exclude>
            <exclude>**/goals.txt</exclude> <!-- shitty plugin -->
            <exclude>**/build.log</exclude> <!-- shitty plugin -->
            <exclude>.jupiter</exclude>
            <exclude>**/*.md</exclude>
            <exclude>**/.gitignore</exclude>
          </excludes>
          <mapping>
            <!--  Unfortunately we use xml.vm extensions to filter xdoc pages.
                  The tag xml.vm is not recognized, so we simply override the
                  vm tag. -->
            <vm>XML_STYLE</vm>
            <jnlp>XML_STYLE</jnlp>
          </mapping>
        </configuration>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
      <id>release</id>

      <activation>
        <property>
          <name>performRelease</name>
          <value>true</value>
        </property>
      </activation>

      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-source-plugin</artifactId>
            <version>${version.maven-source-plugin}</version>
            <executions>
              <execution>
                <id>attach-sources</id>
                <goals>
                  <goal>jar-no-fork</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <version>${version.maven-javadoc-plugin}</version>
            <executions>
              <execution>
                <id>attach-javadocs</id>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <artifactId>maven-deploy-plugin</artifactId>
            <version>${version.maven-deploy-plugin}</version>
            <configuration>
              <updateReleaseInfo>true</updateReleaseInfo>
            </configuration>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>${version.maven-gpg-plugin}</version>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>it</id>
      <!-- mvn -Pit integration-test
               -Dinvoker.test=bmd-it-xxx  (selected tests to run)-->
      <build>
        <defaultGoal>install</defaultGoal>
        <plugins>
          <plugin>
            <artifactId>maven-invoker-plugin</artifactId>
            <version>1.8</version>
            <configuration>
              <debug>false</debug>
              <projectsDirectory>src/it</projectsDirectory>
              <settingsFile>src/it/settings.xml</settingsFile>

              <pomIncludes>
                <pomInclude>*/pom.xml</pomInclude>
              </pomIncludes>

              <cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
              <localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath>
              <preBuildHookScript>setup</preBuildHookScript>
              <postBuildHookScript>verify</postBuildHookScript>

              <goals>
                <goal>clean</goal>
                <goal>verify</goal>
              </goals>
            </configuration>
            <executions>
              <execution>
                <id>integration-test</id>
                <goals>
                  <goal>install</goal>
                  <goal>run</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
