<?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/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <groupId>org.alfasoftware</groupId>
  <artifactId>astra</artifactId>
  <version>2.0.2-alpha2</version>
  <packaging>pom</packaging>
  
  <name>astra</name>
  <description>Astra is a Java tool for analysing and refactoring Java source code.</description>
  <url>https://github.com/alfasoftware/astra</url>
  
  <organization>
    <name>Alfa Financial Software Limited</name>
    <url>https://alfasystems.com</url>
  </organization>
  
  <modules>
    <module>astra-core</module>
    <module>astra-example</module>
    <module>astra-cli</module>
    <module>astra-testing</module>
  </modules>

  <properties>
    <maven.compiler.source>11</maven.compiler.source>
    <maven.compiler.target>11</maven.compiler.target>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    
    <!-- plugin versions -->
    <maven-javadoc-plugin.version>3.3.0</maven-javadoc-plugin.version>
    <maven-source-plugin.version>3.2.1</maven-source-plugin.version>
    <maven-resources-plugin.version>3.1.0</maven-resources-plugin.version>

    <!-- dependency versions -->
    <log4j.version>1.2.16</log4j.version>
    <junit.version>4.11</junit.version>
    
    <!-- sonar properties -->
    <sonar.projectKey>alfasoftware_astra</sonar.projectKey>
    <sonar.moduleKey>${project.groupId}:${project.artifactId}</sonar.moduleKey>
    <sonar.organization>alfasoftware</sonar.organization>
    <sonar.host.url>https://sonarcloud.io</sonar.host.url>
  </properties>
  
  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>org.alfasoftware</groupId>
        <artifactId>astra-core</artifactId>
        <version>${project.version}</version>
      </dependency>
      
      <dependency>
        <groupId>org.alfasoftware</groupId>
        <artifactId>astra-testing</artifactId>
        <version>${project.version}</version>
      </dependency>
      
      <dependency>
        <groupId>log4j</groupId>
        <artifactId>log4j</artifactId>
        <version>${log4j.version}</version>
      </dependency>
          
      <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>${junit.version}</version>
        <scope>test</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>
  
  <dependencies>
    <dependency>
      <groupId>log4j</groupId>
      <artifactId>log4j</artifactId>
    </dependency>
        
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <scope>test</scope>
    </dependency>
  </dependencies>
  
  <licenses>
    <license>
      <name>The Apache License, Version 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
    </license>
  </licenses>
  
  <developers>
    <developer>
      <name>Joseph Hoare</name>
      <email>joseph.hoare@alfasystems.com</email>
      <organization>Alfa Financial Software Limited</organization>
      <organizationUrl>http://alfasystems.com</organizationUrl>
    </developer>
    <developer>
      <name>Oyvind Woller</name>
      <email>oyvind.woller@alfasystems.com</email>
      <organization>Alfa Financial Software Limited</organization>
      <organizationUrl>http://alfasystems.com</organizationUrl>
    </developer>
    <developer>
      <name>Richard Harris</name>
      <email>richard.harris@alfasystems.com</email>
      <organization>Alfa Financial Software Limited</organization>
      <organizationUrl>http://alfasystems.com</organizationUrl>
    </developer>
  </developers>
  
  <issueManagement>
    <system>GitHub Issues</system>
    <url>https://github.com/alfasoftware/astra/issues</url>
  </issueManagement>
  
  <build>
    <plugins>
      <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-javadoc-plugin</artifactId>
         <version>${maven-javadoc-plugin.version}</version>
         <configuration>
           <failOnError>true</failOnError>
           <doclint>none</doclint>
           <quiet>true</quiet>
         </configuration>
         <executions>
            <execution>
               <id>attach-javadocs</id>
               <goals>
                  <goal>jar</goal>
               </goals>
            </execution>
         </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <version>${maven-source-plugin.version}</version>
        <executions>
          <execution>
            <id>attach-sources</id>
            <goals>
              <goal>jar-no-fork</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-resources-plugin</artifactId>
        <version>${maven-resources-plugin.version}</version>
        <executions>
          <execution>
            <id>copy-resources</id>
            <phase>prepare-package</phase>
            <goals>
              <goal>copy-resources</goal>
            </goals>
            <configuration>
              <outputDirectory>${basedir}/target/classes/META-INF</outputDirectory>
              <resources>          
                <resource>
                  <directory>${project.basedir}/..</directory>
                  <includes>
                    <include>LICENSE</include>
                  </includes>
                  <filtering>true</filtering>
                </resource>
              </resources>              
            </configuration>            
          </execution>
        </executions>
      </plugin>        
    </plugins>
  </build>
  
  <profiles>
    <profile>
      <id>coverage</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
          </plugin>
          <plugin>
            <groupId>org.jacoco</groupId>
            <artifactId>jacoco-maven-plugin</artifactId>
            <executions>
              <execution>
                <id>prepare-agent</id>
                <goals>
                  <goal>prepare-agent</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
    
    <profile>
      <id>release</id>
      <properties>
        <gpg.executable>gpg2</gpg.executable>
      </properties>
      <build>
        <plugins>
          <plugin>
            <groupId>org.sonatype.plugins</groupId>
            <artifactId>nexus-staging-maven-plugin</artifactId>
            <version>1.6.7</version>
            <extensions>true</extensions>
            <configuration>
              <serverId>ossrh</serverId>
              <nexusUrl>https://oss.sonatype.org/</nexusUrl>
              <autoReleaseAfterClose>true</autoReleaseAfterClose>
            </configuration>
          </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>${gpg.keyname}</keyname>
                  <passphraseServerId>${gpg.keyname}</passphraseServerId>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
  
  <scm>
    <connection>scm:git:https://github.com/alfasoftware/astra.git</connection>
    <developerConnection>scm:git:git@github.com:alfasoftware/astra.git</developerConnection>
    <url>https://github.com/alfasoftware/astra</url>
    <tag>astra-2.0.2-alpha2</tag>
  </scm>
  
  <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>
</project>
