<?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>
  <parent>
    <groupId>org.sonatype.oss</groupId>
    <artifactId>oss-parent</artifactId>
    <version>7</version>
  </parent>

  <issueManagement>
    <system>Github</system>
    <url>https://github.com/aviatorscript/aviatorscript/issues</url>
  </issueManagement>

  <groupId>io.github.aviatorscript</groupId>
  <artifactId>aviator</artifactId>
  <version>5.9.0</version>
  <name>aviator</name>
  <description>A high performance scripting language hosted on the JVM</description>
  <url>https://github.com/aviatorscript/aviatorscript</url>
  <inceptionYear>2010</inceptionYear>

  <developers>
    <developer>
      <name>dennis zhuang</name>
      <url>https://github.com/killme2008</url>
      <timezone>8</timezone>
    </developer>
  </developers>
  <scm>
    <connection>scm:git:git@github.com:aviatorscript/aviatorscript.git</connection>
    <developerConnection>scm:git:git@github.com:aviatorscript/aviatorscript.git</developerConnection>
    <url>git@github.com:aviatorscript/aviatorscript.git</url>
  </scm>
  <licenses>
    <license>
      <name>Apache License, Version 2.0</name>
      <url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
    </license>
  </licenses>

  <properties>
    <!-- Skip GPG signing by default, enable during deploy with -Dgpg.skip=false -->
    <gpg.skip>false</gpg.skip>
  </properties>

  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.13.1</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-all</artifactId>
      <version>1.10.19</version>
      <scope>test</scope>
    </dependency>
    <!-- https://mvnrepository.com/artifact/org.springframework/spring-core -->
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-context</artifactId>
      <version>5.3.36</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.openjdk.jmh</groupId>
      <artifactId>jmh-core</artifactId>
      <version>1.20</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.openjdk.jmh</groupId>
      <artifactId>jmh-generator-annprocess</artifactId>
      <version>1.20</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.ibeetl</groupId>
      <artifactId>beetl</artifactId>
      <version>3.1.7.RELEASE</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <!--
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>exec-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>run-benchmarks</id>
            <phase>integration-test</phase>
            <goals>
              <goal>exec</goal>
            </goals>
            <configuration>
              <classpathScope>test</classpathScope>
              <executable>java</executable>
              <arguments>
                <argument>-classpath</argument>
                <classpath />
                <argument>org.openjdk.jmh.Main</argument>
                <argument>.*</argument>
              </arguments>
            </configuration>
          </execution>
        </executions>
        </plugin>
      -->
      <plugin>
	<artifactId>maven-source-plugin</artifactId>
	<version>3.1.0</version>
	<executions>
	  <execution>
	    <id>attach-sources</id>
	    <goals>
	      <goal>jar-no-fork</goal>
	    </goals>
	  </execution>
	</executions>
      </plugin>
      <plugin>
	<artifactId>maven-compiler-plugin</artifactId>
	<version>3.8.1</version>
	<configuration>
	  <source>1.8</source>
	  <target>1.8</target>
	  <encoding>UTF-8</encoding>
	</configuration>
      </plugin>
      <plugin>
	<artifactId>maven-assembly-plugin</artifactId>
	<version>3.1.1</version>
	<configuration>
          <descriptorRefs>
            <descriptorRef>jar-with-dependencies</descriptorRef>
          </descriptorRefs>
	  <descriptors>
	    <descriptor>src/assemble/src.xml</descriptor>
	    <descriptor>src/assemble/distribution.xml</descriptor>
	  </descriptors>
	  <archive>
	    <manifest>
	      <mainClass>com.googlecode.aviator.Main</mainClass>
	    </manifest>
	  </archive>
	</configuration>
      </plugin>
      <plugin>
	<artifactId>maven-jar-plugin</artifactId>
	<version>2.3.1</version>
	<configuration>
	  <archive>
	    <manifest>
	      <mainClass>com.googlecode.aviator.Main</mainClass>
	    </manifest>
	  </archive>
	</configuration>
      </plugin>
      <plugin>
	<groupId>org.eluder.coveralls</groupId>
	<artifactId>coveralls-maven-plugin</artifactId>
	<version>4.3.0</version>
      </plugin>
      <plugin>
	<groupId>org.jacoco</groupId>
	<artifactId>jacoco-maven-plugin</artifactId>
	<version>0.8.11</version>
	<executions>
	  <execution>
	    <goals>
	      <goal>prepare-agent</goal>
	    </goals>
	  </execution>
	  <execution>
	    <id>report</id>
	    <phase>test</phase>
	    <goals>
	      <goal>report</goal>
	    </goals>
	  </execution>
	</executions>
      </plugin>
      <plugin>
	<!-- Automatically close and deploy from OSSRH -->
	<groupId>org.sonatype.central</groupId>
	<artifactId>central-publishing-maven-plugin</artifactId>
	<version>0.6.0</version>
	<extensions>true</extensions>
	<configuration>
	  <publishingServerId>ossrh</publishingServerId>
	  <tokenAuth>true</tokenAuth>
	  <!-- Release versions will be synced to Maven Central automatically. -->
	  <autoPublish>true</autoPublish>
	</configuration>
      </plugin>
      <plugin>
	<artifactId>maven-gpg-plugin</artifactId>
	<version>3.2.7</version>
	<executions>
	  <execution>
	    <id>sign-artifacts</id>
	    <phase>verify</phase>
	    <goals>
	      <goal>sign</goal>
	    </goals>
	  </execution>
	</executions>
	<configuration>
	  <!-- Skip signing by default, enable during deploy -->
	  <skip>${gpg.skip}</skip>
	  <!-- Prevent gpg from using pinentry programs -->
	  <gpgArguments>
	    <arg>--pinentry-mode</arg>
	    <arg>loopback</arg>
	  </gpgArguments>
	</configuration>
      </plugin>
    </plugins>
    <pluginManagement>
      <plugins>
	<plugin>
	  <artifactId>maven-deploy-plugin</artifactId>
	  <version>2.8.2</version>
	</plugin>
      </plugins>
    </pluginManagement>
  </build>
  <distributionManagement>
    <snapshotRepository>
      <id>ossrh</id>
      <url>https://central.sonatype.com</url>
    </snapshotRepository>
  </distributionManagement>
  <profiles>
    <profile>
      <id>auto-activation-for-jdk8+</id>
      <activation>
	<jdk>[1.8,)</jdk>
      </activation>
      <build>
	<!-- blow plugins require jdk8+ -->
	<plugins>
	  <!-- formatter and sort pom -->
	  <plugin>
	    <groupId>net.revelc.code.formatter</groupId>
	    <artifactId>formatter-maven-plugin</artifactId>
	    <version>2.9.0</version>
	    <configuration>
	      <configFile>${project.basedir}/eclipse-java-google-style.xml</configFile>
	      <lineEnding>LF</lineEnding>
	      <encoding>utf-8</encoding>
	    </configuration>
	    <executions>
	      <execution>
		<goals>
		  <goal>format</goal>
		</goals>
	      </execution>
	    </executions>
	  </plugin>
	  <plugin>
	    <artifactId>maven-javadoc-plugin</artifactId>
	    <version>3.11.1</version>
	    <configuration>
	      <source>11</source>
	      <detectJavaApiLink>false</detectJavaApiLink>
	      <!-- Turn off Java 8 strict Javadoc checking -->
	      <doclint>none</doclint>
	      <sourceFileIncludes>
		<sourceFileInclude>**/*.java</sourceFileInclude>
	      </sourceFileIncludes>
	    </configuration>
	    <executions>
	      <execution>
		<id>attach-javadoc</id>
		<goals>
		  <goal>jar</goal>
		</goals>
	      </execution>
	    </executions>
	  </plugin>
	  <plugin>
	    <groupId>org.apache.maven.plugins</groupId>
	    <artifactId>maven-shade-plugin</artifactId>
	    <version>3.1.0</version>
	    <executions>
	      <execution>
		<phase>package</phase>
		<goals>
		  <goal>shade</goal>
		</goals>
		<configuration>
		  <transformers>
		    <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
		      <mainClass>com.googlecode.aviator.Main</mainClass>
		    </transformer>
		  </transformers>
		  <outputFile>aviator.jar</outputFile>
		</configuration>
	      </execution>
	    </executions>
	  </plugin>
	</plugins>
      </build>
    </profile>
    <profile>
      <id>release</id>
      <activation>
	<activeByDefault>false</activeByDefault>
	<property>
	  <!-- where property `performRelease` comes from? - maven-release-plugin
	       Whether to use the release profile that adds sources and javadocs to the
	       released artifact, if appropriate. If set to true, the release plugin sets
	       the property "performRelease" to true, which activates the profile "release-profile",
	       which is inherited from the super pom. Default value is: true. https://maven.apache.org/plugins-archives/maven-release-plugin-2.2.2/perform-mojo.html
	       - All models implicitly inherit from a super-POM which added maven-source-plugin
	       and maven-javadoc-plugin https://maven.apache.org/ref/3.0.4/maven-model-builder/super-pom.html -->
	  <name>performRelease</name>
	  <value>true</value>
	</property>
      </activation>
      <build>
	<plugins>
	  <!-- Maven plugin which includes build-time git repository information
	       into an POJO / *.properties). Make your apps tell you which version exactly
	       they were built from! Priceless in large distributed deployments. https://github.com/ktoso/maven-git-commit-id-plugin -->
	  <plugin>
	    <groupId>pl.project13.maven</groupId>
	    <artifactId>git-commit-id-plugin</artifactId>
	    <version>3.0.0</version>
	    <executions>
	      <execution>
		<id>get-the-git-infos</id>
		<goals>
		  <goal>revision</goal>
		</goals>
	      </execution>
	      <execution>
		<id>validate-the-git-infos</id>
		<goals>
		  <goal>validateRevision</goal>
		</goals>
	      </execution>
	    </executions>
	    <configuration>
	      <validationProperties>
		<!-- verify that the current repository is not dirty -->
		<validationProperty>
		  <name>validating git dirty</name>
		  <value>${git.dirty}</value>
		  <shouldMatchTo>false</shouldMatchTo>
		</validationProperty>
	      </validationProperties>
	      <generateGitPropertiesFile>true</generateGitPropertiesFile>
	      <generateGitPropertiesFilename>${project.build.outputDirectory}/META-INF/scm/${project.groupId}/${project.artifactId}/git.properties</generateGitPropertiesFilename>
	    </configuration>
	  </plugin>
	</plugins>
      </build>
    </profile>
  </profiles>
  <reporting>
    <plugins>
      <plugin>
	<artifactId>maven-javadoc-plugin</artifactId>
	<configuration>
	  <encoding>utf-8</encoding>
	  <charset>utf-8</charset>
	</configuration>
      </plugin>
    </plugins>
  </reporting>
</project>
