<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>
  <groupId>org.beangle</groupId>
  <artifactId>beangle-java</artifactId>
  <packaging>pom</packaging>
  <version>29.0</version>
  <name>Beangle Java Parent</name>
  <inceptionYear>2005</inceptionYear>
  <description>
    Beangle provides agile development scaffold and toolkits.
  </description>

  <licenses>
    <license>
      <name>GNU Lesser General Public License</name>
      <url>http://www.gnu.org/licenses/lgpl.txt</url>
    </license>
  </licenses>

  <organization>
    <name>The Beangle Software</name>
    <url>https://github.com/beangle/beangle-java</url>
  </organization>

  <url>http://beangle.github.io</url>

  <scm>
    <connection>scm:git:git://github.com/beangle/beangle-java.git</connection>
    <developerConnection>scm:git:git@github.com:beangle/beangle-java.git</developerConnection>
    <url>https://github.com/beangle/beangle-java</url>
  </scm>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <organization.slogan>Beangle, Agile Development Scaffold and Toolkits.</organization.slogan>
    <downloadJavadocs>false</downloadJavadocs>
    <java.version>17</java.version>
    <beangle.version>29.0</beangle.version>

    <mvn.compiler.version>3.13.0</mvn.compiler.version>
    <mvn.deploy.version>3.1.3</mvn.deploy.version>
    <mvn.clean.version>3.4.0</mvn.clean.version>
    <mvn.install.version>3.1.3</mvn.install.version>
    <mvn.javadoc.version>3.11.2</mvn.javadoc.version>
    <mvn.source.version>3.3.1</mvn.source.version>
    <mvn.jar.version>3.4.2</mvn.jar.version>
    <mvn.war.version>3.4.0</mvn.war.version>
    <mvn.license.version>4.6</mvn.license.version>
    <mvn.release.version>3.1.1</mvn.release.version>
    <mvn.surefire.version>3.5.2</mvn.surefire.version>
    <mvn.surefire.report.version>3.5.2</mvn.surefire.report.version>
    <mvn.checkstyle.version>3.6.0</mvn.checkstyle.version>
    <mvn.bundle.version>5.1.2</mvn.bundle.version>
    <mvn.gpg.version>3.2.7</mvn.gpg.version>
    <mvn.scm.gitprovider.version>2.1.0</mvn.scm.gitprovider.version>
    <mvn.site.version>3.21.0</mvn.site.version>
    <mvn.project.info.version>3.8.0</mvn.project.info.version>

    <slf4j.version>2.0.16</slf4j.version>
    <logback.version>1.5.16</logback.version>
    <servletapi.version>6.0.0</servletapi.version>
    <testng.version>7.10.2</testng.version>
    <junit.version>4.13.2</junit.version>
    <mockito.version>3.9.0</mockito.version>
    <h2.version>2.3.232</h2.version>
    <hsqldb.version>2.7.4</hsqldb.version>
    <postgresql.version>42.7.4</postgresql.version>

    <mvn.jxr.version>3.6.0</mvn.jxr.version>
    <mvn.pmd.version>3.26.0</mvn.pmd.version>
    <mvn.cobertura.version>2.7</mvn.cobertura.version>
    <additionalparam>-Xdoclint:none</additionalparam>
  </properties>

  <developers>
    <developer>
      <name>Tihua Duan</name>
      <id>chaostone</id>
      <email>duantihua@gmail.com</email>
      <roles>
        <role>Committer</role>
      </roles>
    </developer>
  </developers>

  <build>
    <defaultGoal>clean install</defaultGoal>
    <plugins>
      <!-- central发布插件 -->
      <plugin>
        <groupId>org.sonatype.central</groupId>
        <artifactId>central-publishing-maven-plugin</artifactId>
        <version>0.6.0</version>
        <extensions>true</extensions>
        <configuration>
          <publishingServerId>central</publishingServerId>
          <autoPublish>true</autoPublish>
          <deploymentName>${project.groupId}:${project.artifactId}:${project.version}</deploymentName>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-deploy-plugin</artifactId>
        <version>${mvn.deploy.version}</version>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-clean-plugin</artifactId>
        <version>${mvn.clean.version}</version>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-install-plugin</artifactId>
        <version>${mvn.install.version}</version>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>${mvn.javadoc.version}</version>
        <executions>
          <execution>
            <id>attach-javadocs</id>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <doclint>none</doclint>
          <javadocExecutable>${java.home}/bin/javadoc</javadocExecutable>
          <charset>UTF-8</charset>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <version>${mvn.source.version}</version>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <version>${mvn.jar.version}</version>
        <configuration>
          <archive>
            <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
          </archive>
        </configuration>
      </plugin>

      <plugin>
        <groupId>com.mycila</groupId>
        <artifactId>license-maven-plugin</artifactId>
        <version>${mvn.license.version}</version>
        <configuration>
          <strictCheck>true</strictCheck>
          <inlineHeader><![CDATA[
${organization.slogan}

Copyright © ${project.inceptionYear}, ${project.organization.name}.

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 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 Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.]]>
          </inlineHeader>
          <includes>
            <include>src/main/java/**</include>
            <include>src/main/scala/**</include>
            <include>src/test/java/**</include>
            <include>src/test/scala/**</include>
          </includes>
          <excludes>
            <exclude>src/**/package-info.java</exclude>
          </excludes>
          <properties>
            <email>duantihua@163.com</email>
          </properties>
          <mapping>
            <java>SLASHSTAR_STYLE</java>
            <scala>SLASHSTAR_STYLE</scala>
          </mapping>
        </configuration>
        <executions>
          <execution>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.beangle</groupId>
        <artifactId>style-maven-plugin</artifactId>
        <version>28.2</version>
        <executions>
          <execution>
            <goals>
              <goal>ws-check</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-release-plugin</artifactId>
        <version>${mvn.release.version}</version>
        <dependencies>
          <dependency>
            <groupId>org.apache.maven.scm</groupId>
            <artifactId>maven-scm-provider-gitexe</artifactId>
            <version>${mvn.scm.gitprovider.version}</version>
          </dependency>
        </dependencies>
        <configuration>
          <autoVersionSubmodules>true</autoVersionSubmodules>
          <tagNameFormat>@{project.version}</tagNameFormat>
          <mavenExecutorId>forked-path</mavenExecutorId>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>${mvn.surefire.version}</version>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-checkstyle-plugin</artifactId>
        <version>${mvn.checkstyle.version}</version>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-war-plugin</artifactId>
        <version>${mvn.war.version}</version>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>${mvn.compiler.version}</version>
        <configuration>
          <source>${java.version}</source>
          <target>${java.version}</target>
          <release>${java.version}</release>
          <encoding>${project.build.sourceEncoding}</encoding>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-bundle-plugin</artifactId>
        <version>${mvn.bundle.version}</version>
        <configuration>
          <instructions>
            <Bundle-SymbolicName>${bundle.symbolicName}</Bundle-SymbolicName>
            <Bundle-Version>${project.version}</Bundle-Version>
            <Bundle-Name>${project.artifactId}</Bundle-Name>
            <Export-Package>!${bundle.namespace}*internal*,${bundle.namespace}.*;version="${project.version}"
            </Export-Package>
            <Private-Package>${bundle.namespace}*internal*</Private-Package>
            <Import-Package>*;resolution:=optional</Import-Package>
            <_include>-osgi.bnd</_include>
          </instructions>
        </configuration>
        <executions>
          <execution>
            <id>bundle-manifest</id>
            <phase>process-classes</phase>
            <goals>
              <goal>manifest</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <dependencyManagement>
    <dependencies>
      <!--log-->
      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-api</artifactId>
        <version>${slf4j.version}</version>
      </dependency>
      <dependency>
        <groupId>ch.qos.logback</groupId>
        <artifactId>logback-core</artifactId>
        <version>${logback.version}</version>
        <scope>runtime</scope>
      </dependency>
      <dependency>
        <groupId>ch.qos.logback</groupId>
        <artifactId>logback-classic</artifactId>
        <version>${logback.version}</version>
        <scope>runtime</scope>
      </dependency>
      <dependency>
        <groupId>jakarta.servlet</groupId>
        <artifactId>jakarta.servlet-api</artifactId>
        <version>${servletapi.version}</version>
        <scope>provided</scope>
      </dependency>
      <!--test-->
      <dependency>
        <groupId>org.mockito</groupId>
        <artifactId>mockito-core</artifactId>
        <version>${mockito.version}</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.testng</groupId>
        <artifactId>testng</artifactId>
        <version>${testng.version}</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>${junit.version}</version>
        <scope>test</scope>
      </dependency>
      <!-- jdbc driver -->
      <dependency>
        <groupId>com.h2database</groupId>
        <artifactId>h2</artifactId>
        <version>${h2.version}</version>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <reporting>
    <plugins>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>cobertura-maven-plugin</artifactId>
        <version>${mvn.cobertura.version}</version>
        <configuration>
          <instrumentation>
            <excludes>
              <exclude>**/model/**/*.class</exclude>
            </excludes>
          </instrumentation>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-site-plugin</artifactId>
        <version>${mvn.site.version}</version>
        <configuration>
          <locales>zh_CN</locales>
          <outputEncoding>UTF-8</outputEncoding>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-project-info-reports-plugin</artifactId>
        <version>${mvn.project.info.version}</version>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-report-plugin</artifactId>
        <version>${mvn.surefire.report.version}</version>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jxr-plugin</artifactId>
        <version>${mvn.jxr.version}</version>
        <configuration>
          <aggregate>true</aggregate>
          <inputEncoding>UTF-8</inputEncoding>
          <outputEncoding>UTF-8</outputEncoding>
          <docTitle>Beangle ${project.version} Cross Reference</docTitle>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-pmd-plugin</artifactId>
        <version>${mvn.pmd.version}</version>
        <configuration>
          <rulesets>
            <ruleset>/rulesets/basic.xml</ruleset>
            <ruleset>/rulesets/imports.xml</ruleset>
            <ruleset>/rulesets/unusedcode.xml</ruleset>
            <ruleset>/rulesets/codesize.xml</ruleset>
            <ruleset>/rulesets/clone.xml</ruleset>
            <ruleset>/rulesets/coupling.xml</ruleset>
            <ruleset>/rulesets/strings.xml</ruleset>
            <!--<ruleset>/rulesets/naming.xml</ruleset>-->
            <ruleset>/rulesets/logging-java.xml</ruleset>
            <ruleset>/rulesets/logging-jakarta-commons.xml</ruleset>
            <!--<ruleset>/rulesets/optimizations.xml</ruleset>-->
            <ruleset>/rulesets/braces.xml</ruleset>
            <ruleset>/rulesets/design.xml</ruleset>
            <!--<ruleset>/rulesets/javabeans.xml</ruleset>-->
            <ruleset>/rulesets/strictexception.xml</ruleset>
            <!--<ruleset>/rulesets/controversial.xml</ruleset>
                <ruleset>/rulesets/finalizers.xml</ruleset>-->
          </rulesets>
          <reportSet>
            <reports>
              <report>pmd</report>
              <report>cpd</report>
            </reports>
          </reportSet>
          <linkXref>true</linkXref>
          <minimumTokens>100</minimumTokens>
          <targetJdk>11</targetJdk>
        </configuration>
      </plugin>
    </plugins>
  </reporting>

  <profiles>
    <profile>
      <id>beangle-release</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>
            <version>${mvn.gpg.version}</version>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
