<?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/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <groupId>org.beigesoft</groupId>
  <version>1.0</version>
  <artifactId>beige-accjet</artifactId>
  <name>Beigesoft™ Enterprise Information System standalone WEB-application.</name>

  <description>Beigesoft™ Enterprise Information System is standalone JEE web application that runs on embedded A-Jetty.
    Web-Store is included for study and tests purposes, and you are also able to make full DB copy from cloud version,
    and you can make price lists (in different price categories) and export it in CSV file to your customers or POS.</description>
  <url>https://sites.google.com/site/beigesoftware</url>
  <inceptionYear>2019</inceptionYear>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <java.version>1.7</java.version>
  </properties>

  <profiles>
    <profile>
      <id>release</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-source-plugin</artifactId>
            <version>2.2.1</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>2.10.2</version>
            <executions>
              <execution>
                <id>attach-javadocs</id>
                <goals>
                  <goal>jar</goal>
                </goals>
                <configuration>
                  <additionalparam>-Xdoclint:none</additionalparam>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-assembly-plugin</artifactId>
            <version>2.4</version><!--3.0.0 can't make jar-with-dependencies (too long and bad jar), and so does with previous 1.1.8 version!-->
            <executions>
              <execution>
                <id>make-zip</id>
                <configuration>
                  <descriptors>
                    <descriptor>asm-zip.xml</descriptor>
                  </descriptors>
                </configuration>
                <phase>verify</phase>
                <goals>
                  <goal>single</goal>
                </goals>
              </execution>
              <execution><!--current resources (e.g. MessagesAjetty_en_US.properties) are overwritten with dependency's ones (a-jetty-swing:jar/resources/*)?!
                Using custom descriptor jarwdep.xml gives same result for any ordered dependencies list, and so does 2.5.5, 2.6, 3.1.1!
                But it works fine on previous 1.1.8 version with the same 3-d party dependencies (BC...) and plugins????-->
                <id>jar-with-dependencies</id>
                <phase>package</phase>
                <goals>
                  <goal>single</goal>
                </goals>
                <configuration>
                  <archive>
                    <manifest>
                      <mainClass>org.beigesoft.ajetty.BootMain</mainClass>
                    </manifest>
                  </archive>
                  <descriptorRefs>
                    <descriptorRef>jar-with-dependencies</descriptorRef>
                  </descriptorRefs>
                </configuration>
              </execution>
              <execution>
                <id>tar.bz2</id>
                <configuration>
                  <descriptors>
                    <descriptor>assembly.xml</descriptor>
                  </descriptors>
                </configuration>
                <phase>package</phase>
                <goals>
                  <goal>single</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-jarsigner-plugin</artifactId>
            <version>1.4</version>
            <executions>
              <execution>
                <id>signing</id>
                <goals>
                  <goal>sign</goal>
                </goals>
                <phase>package</phase>
                <inherited>true</inherited>
                <configuration>
                  <archiveDirectory />
                  <includes>
                    <include>target${file.separator}*.jar</include>
                  </includes>
                  <storepass>${signpass}</storepass>
                  <keypass>${signpass}</keypass>
                  <alias>${signalias}</alias>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>1.6</version>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
                <configuration>
                  <keyname>${gpgkeyname}</keyname>
                  <passphraseServerId>${gpgkeyname}</passphraseServerId>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>check</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-checkstyle-plugin</artifactId>
            <version>3.1.0</version>
            <executions>
              <execution>
              <id>checkstyle</id>
              <phase>verify</phase>
              <goals>
                <goal>check</goal>
              </goals>
              </execution>
            </executions>
            <configuration>
              <suppressionsLocation>checkstyle-suppressions.xml</suppressionsLocation>
              <excludes>**/apache/**</excludes>
            </configuration>
          </plugin>
          <plugin>
            <groupId>com.github.spotbugs</groupId>
            <artifactId>spotbugs-maven-plugin</artifactId>
            <version>3.1.12.2</version>
            <configuration>
              <excludeFilterFile>findbug-exclude.xml</excludeFilterFile>
            </configuration>
            <executions>
              <execution>
              <id>spotbugs</id>
              <phase>verify</phase>
              <goals>
                <goal>check</goal>
              </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-pmd-plugin</artifactId>
            <version>3.12.0</version>
            <configuration>
              <printFailingErrors>true</printFailingErrors>
              <excludes>
                <exclude>**/apache/**</exclude>
              </excludes>
            </configuration>
            <executions>
              <execution>
              <id>pmd</id>
              <phase>verify</phase>
              <goals>
                <goal>check</goal>
              </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

  <dependencies>
    <dependency>
      <groupId>org.beigesoft</groupId>
      <artifactId>beige-acc</artifactId>
      <version>1.0</version>
    </dependency>
    <dependency>
      <groupId>org.beigesoft</groupId>
      <artifactId>beige-web-jar</artifactId>
      <version>1.0</version>
    </dependency>
    <dependency>
      <groupId>com.github.demidenko05</groupId>
      <artifactId>a-jetty-swing</artifactId>
      <version>1.0.5</version>
    </dependency>
    <dependency>
      <groupId>org.xerial</groupId>
      <artifactId>sqlite-jdbc</artifactId>
      <version>3.21.0.1</version>
    </dependency>
  </dependencies>

  <build>
    <finalName>${project.artifactId}</finalName>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-install-plugin</artifactId>
        <version>2.5.2</version>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-deploy-plugin</artifactId>
        <version>2.8.2</version>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-resources-plugin</artifactId>
        <version>2.7</version>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>2.22.1</version>
        <configuration>
          <useSystemClassLoader>false</useSystemClassLoader>
          <useFile>false</useFile>
          <trimStackTrace>false</trimStackTrace>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.1</version>
        <configuration>
          <source>${java.version}</source>
          <target>${java.version}</target>
          <compilerArgs>
            <!--<arg>-verbose</arg>-->
            <arg>-Xlint:all,-options,-path</arg>
          </compilerArgs>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-release-plugin</artifactId>
        <version>2.5.3</version>
      </plugin>
    </plugins>
  </build>
  
  <developers>
    <developer><name>Yury Demidenko</name></developer>
  </developers>

  <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>
  </distributionManagement>

  <licenses>
    <license>
      <name>BSD 2-Clause License</name>
      <url>https://sites.google.com/site/beigesoftware/bsd2csl</url>
      <distribution>repo</distribution>
    </license>
  </licenses>
  
  <scm>
    <url>https://github.com/demidenko05/beige-accjet.git</url>
    <connection>scm:git:git@github.com:demidenko05/beige-accjet.git</connection>
    <developerConnection>scm:git:git@github.com:demidenko05/beige-accjet.git</developerConnection>
    <tag>beige-accjet-1.0</tag>
  </scm>

</project>
