<?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>uno.anahata</groupId>
    <artifactId>anahata-os-pom</artifactId>
    <version>2.0.0</version>    
    <packaging>pom</packaging>
    
    <name>Anahata OS pom</name>    
    <description>Parent pom for Anahata OS projects</description>
    <url>https://bitbucket.org/anahata/anahata-os-pom</url>
    
    <scm>
        <connection>scm:git:git://bitbucket.org/anahata/${project.artifactId}.git</connection>
        <developerConnection>scm:git:ssh://bitbucket.org:anahata/${project.artifactId}.git</developerConnection>
        <url>https://bitbucket.org/anahata/${project.artifactId}/src</url>
    </scm>

    <licenses>
        <license>
            <name>The Apache Software License, Version 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
            <distribution>repo</distribution>
        </license>
    </licenses>
    
    <organization>
        <name>Anahata</name>
        <url>http://www.anahata.uno/</url>
    </organization>

    <developers>
        <developer>
            <name>Priyadarshi</name>
            <email>priya@anahata.uno</email>
            <organization>Anahata</organization>
            <organizationUrl>http://www.anahata.uno</organizationUrl>
            <roles>
                <role>developer</role>
            </roles>
        </developer>
        
    </developers>
    
    <ciManagement>
        <system>Jenkins</system>
        <url>http://ci.anahata.uno/job/${project.artifactId}</url>
    </ciManagement>

    <properties>
        <maven.build.timestamp.format>yyyyMMdd-HHmm</maven.build.timestamp.format>
        <build.timestamp>${maven.build.timestamp}</build.timestamp>
        <BUILD_NUMBER>LOCAL</BUILD_NUMBER>
        <java.version>1.8</java.version>
    </properties>

    <repositories>
        <repository>
            <id>anahata</id>
            <name>Anahata Public Enterprise Repository</name>
            <url>http://repo.anahata.uno/artifactory/anahata-public/</url>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>
        
        <repository>
            <id>ossrh</id>
            <name>Sonatype Nexus Snapshots</name>
            <url>
                https://oss.sonatype.org/content/repositories/snapshots
            </url>
            <releases>
                <enabled>false</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>
        
    </repositories>
    
    <distributionManagement>
        <site>
            <id>${project.artifactId}-site</id>
            <url>http://anahata.uno/os/</url>
        </site>
        <snapshotRepository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
    </distributionManagement>

    <pluginRepositories>
        <pluginRepository>
            <id>anahata</id>
            <name>Anahata Public Enterprise Repository</name>
            <url>http://repo.anahata.uno/artifactory/anahata-public/</url>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </pluginRepository>
    </pluginRepositories>

    <build>
        <plugins>
            
            <plugin>
                <groupId>org.jboss.jandex</groupId>
                <artifactId>jandex-maven-plugin</artifactId>
                <version>1.0.3</version>
                <executions>
                    <execution>
                        <id>make-index</id>
                        <goals>
                            <goal>jandex</goal>
                        </goals>
                        <configuration>
                            <fileSets>
                                <fileSet>
                                    <directory>${project.build.directory}/classes</directory>
                                    <excludes>
                                        <exclude>**/*_mm*</exclude>
                                    </excludes>
                                </fileSet>
                            </fileSets>
                        </configuration>                        
                    </execution>
                </executions>
            </plugin>
            
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>license-maven-plugin</artifactId>
                <version>1.19</version>
                <configuration>
                    <licenseName>mit</licenseName>
                    <organizationName><![CDATA[<A HREF="http://www.anahata.uno">Anahata</A>]]></organizationName>
                    <lineLength>120</lineLength>
                    <inceptionYear>2016</inceptionYear>
                    <projectName>${project.name}</projectName>
                </configuration>
            </plugin>  
                      
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.6.0</version>

                <configuration>
                    <source>${java.version}</source>
                    <target>${java.version}</target>
                </configuration>
            </plugin>
            
        </plugins>

    </build>


    <profiles>
        <profile>
            <id>publish</id>
            <build>    
                <plugins>
                    <plugin>
                        <artifactId>maven-resources-plugin</artifactId>
                        <version>3.0.1</version>
                        <executions>
                            <execution>
                                <id>publish-resources-versioned</id>
                                <phase>post-site</phase>
                                <goals>
                                    <goal>copy-resources/</goal>
                                </goals>
                                <configuration>
                                    <outputDirectory>../../anahata-website/workspace/${project.artifactId}/${project.version}</outputDirectory>
                                    <resources>
                                        <resource>
                                            <directory>target/staging/${project.artifactId}</directory>
                                            <filtering>true</filtering>
                                        </resource>
                                    </resources>
                                </configuration>
                            </execution>
                            <execution>
                                <id>publish-resources-latest</id>
                                <phase>post-site</phase>
                                <goals>
                                    <goal>copy-resources</goal>
                                </goals>
                                <configuration>
                                    <outputDirectory>../../anahata-website/workspace/${project.artifactId}/latest</outputDirectory>
                                    <resources>
                                        <resource>
                                            <directory>target/staging/${project.artifactId}</directory>
                                            <filtering>true</filtering>
                                        </resource>
                                    </resources>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-site-plugin</artifactId>
                        <version>3.6</version>
                        <configuration>
                        </configuration>                        
                    </plugin>
                </plugins>
            </build>
        </profile>
        
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                        <version>1.6.8</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-source-plugin</artifactId>
                        <version>2.1.2</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.7</version>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>1.5</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>        
    </profiles>
</project>
