<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright (c) 2014. Knowledge Media Institute - The Open University
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~     http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->

<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>uk.ac.open.kmi.msm4j</groupId>
    <artifactId>msm4j-parent</artifactId>
    <packaging>pom</packaging>
    <version>1.3.2</version>

    <name>MSM4J</name>
    <url>http://kmi.github.io/msm4j/latest</url>
    <description>
        MSM4J is a Java library for manipulating service descriptions expressed in terms of the Minimal
        Service Model vocabulary.
    </description>

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

    <scm>
        <url>https://github.com/kmi/msm4j</url>
        <connection>scm:git:git@github.com:kmi/msm4j.git</connection>
        <developerConnection>scm:git:git@github.com:kmi/msm4j.git</developerConnection>
        <tag>v1.3.2</tag>
    </scm>

    <issueManagement>
        <system>GitHub</system>
        <url>https://github.com/kmi/msm4j/issues</url>
    </issueManagement>

    <distributionManagement>
        <!-- Github site -->
        <site>
            <id>github-pages-site</id>
            <name>Deployment through GitHub's site deployment plugin</name>
            <url>${site.path}</url>
        </site>
        <!-- Releases to repository -->
        <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>

    <developers>
        <developer>
            <id>cpedrinaci</id>
            <name>Carlos Pedrinaci</name>
            <email>c.pedrinaci-{AT}-open.ac.uk</email>
            <url>http://people.kmi.open.ac.uk/carlos/</url>
            <organization>Knowledge Media Institute - The Open University</organization>
            <organizationUrl>http://kmi.open.ac.uk</organizationUrl>
        </developer>
        <developer>
            <id>dong</id>
            <name>Dong Liu</name>
            <email>d.liu-{AT}-open.ac.uk</email>
            <organization>Knowledge Media Institute - The Open University</organization>
            <organizationUrl>http://kmi.open.ac.uk</organizationUrl>
        </developer>
        <developer>
            <id>jkopecky</id>
            <name>Jacek Kopecky</name>
            <email>j.kopecky-{AT}-open.ac.uk</email>
            <organization>Knowledge Media Institute - The Open University</organization>
            <organizationUrl>http://kmi.open.ac.uk</organizationUrl>
        </developer>
        <developer>
            <id>pablo</id>
            <name>Pablo Rodriguez Mier</name>
            <email>pablo.rodriguez.mier-{AT}-usc.es</email>
            <organization>CITIUS - Universidad de Santiago de Compostela</organization>
            <organizationUrl>http://citius.usc.es</organizationUrl>
        </developer>
        <developer>
            <id>izzyblues</id>
            <name>Luca Panziera</name>
            <email>luca.panziera-{AT}-open.ac.uk</email>
            <organization>Knowledge Media Institute - The Open University</organization>
            <organizationUrl>http://kmi.open.ac.uk</organizationUrl>
        </developer>
    </developers>

    <organization>
        <name>Knowledge Media Institute - The Open University</name>
        <url>http://kmi.open.ac.uk</url>
    </organization>

    <properties>
        <!-- Convenience properties for all subprojects -->
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.source>1.6</maven.compiler.source>
        <maven.compiler.target>1.6</maven.compiler.target>
        <junit.version>4.8.2</junit.version>
        <jena.version>2.11.0</jena.version>
        <slf4j.version>1.7.5</slf4j.version>
        <guice.version>3.0</guice.version>
        <guava.version>14.0</guava.version>
        <commons-config.version>1.9</commons-config.version>
        <sws-test-collections.version>1.0.0</sws-test-collections.version>

        <!-- Configuration for GitHub deployment -->
        <site.path>${project.version}</site.path>
        <github.global.server>github</github.global.server>
        <repositoryName>msm4j</repositoryName>
        <repositoryOwner>kmi</repositoryOwner>
    </properties>

    <modules>
        <module>msm4j-vocabulary</module>
        <module>msm4j-io</module>
        <module>msm4j-hrests-transformer</module>
        <module>msm4j-owls-transformer</module>
        <module>msm4j-sawsdl-transformer</module>
        <module>msm4j-wsc-transformer</module>
        <module>msm4j-swagger-transformer</module>
    </modules>

    <dependencies>
        <!-- Logging -->
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>${slf4j.version}</version>
        </dependency>
        <!-- Use Log4j binding (replaceable) -->
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-log4j12</artifactId>
            <version>${slf4j.version}</version>
            <scope>runtime</scope>
        </dependency>

        <!--Test dependencies-->
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>${junit.version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <profiles>
        <!-- Profile activated on release -->
        <profile>
            <id>release</id>
            <activation>
                <property>
                    <name>performRelease</name>
                    <value>true</value>
                </property>
            </activation>
            <build>
                <plugins>
                    <!-- Activate PGP signing only when performing a release -->
                    <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>

                    <!-- Generate source jar on release -->
                    <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>

                    <!-- Generate javadoc jar on release -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>2.9.1</version>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <!-- Profile for updating the latest Web page on github site -->
        <profile>
            <id>update-latest</id>
            <properties>
                <site.path>latest</site.path>
            </properties>
        </profile>
    </profiles>

    <build>
        <testResources>
            <testResource>
                <directory>${shared.resources.dir}</directory>
                <filtering>true</filtering>
            </testResource>
        </testResources>
        <plugins>
            <!-- Configure Maven site plugin for Reflow skin and Markdown support -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-site-plugin</artifactId>
                <version>3.3</version>
                <dependencies>
                    <dependency>
                        <!-- Markdown support for writing website content -->
                        <groupId>org.apache.maven.doxia</groupId>
                        <artifactId>doxia-module-markdown</artifactId>
                        <version>1.3</version>
                    </dependency>
                </dependencies>
                <configuration>
                    <port>10000</port>
                    <generateReports>true</generateReports>
                    <inputEncoding>UTF-8</inputEncoding>
                    <outputEncoding>UTF-8</outputEncoding>
                    <!-- Site deployment done using GitHub site plugin -->
                    <skipDeploy>true</skipDeploy>
                </configuration>
            </plugin>

            <!-- GitHub site plug-in for deployment to GitHub pages -->
            <plugin>
                <groupId>com.github.github</groupId>
                <artifactId>site-maven-plugin</artifactId>
                <version>0.11</version>
                <configuration>
                    <message>Creating site for ${project.artifactId}, ${project.version}</message>
                    <!-- this does the trick to place every module in the correct subfolder -->
                    <path>${project.distributionManagement.site.url}</path>
                    <merge>true</merge>
                    <!--<dryRun>true</dryRun>-->
                </configuration>
                <executions>
                    <execution>
                        <id>github-site</id>
                        <goals>
                            <goal>site</goal>
                        </goals>
                        <phase>site-deploy</phase>
                    </execution>
                </executions>
            </plugin>

            <!-- Maven Release Configuration for nexus staging -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <version>2.5.1</version>
                <configuration>
                    <tagNameFormat>v@{project.version}</tagNameFormat>
                    <autoVersionSubmodules>true</autoVersionSubmodules>
                    <useReleaseProfile>false</useReleaseProfile>
                    <releaseProfiles>release</releaseProfiles>
                    <!--<goals>deploy site-deploy</goals>-->
                    <goals>deploy</goals>
                </configuration>
            </plugin>

            <!-- Staging to Sonatype -->
            <plugin>
                <groupId>org.sonatype.plugins</groupId>
                <artifactId>nexus-staging-maven-plugin</artifactId>
                <version>1.6.3</version>
                <extensions>true</extensions>
                <configuration>
                    <serverId>ossrh</serverId>
                    <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                    <autoReleaseAfterClose>true</autoReleaseAfterClose>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <reporting>
        <plugins>
            <!--Javadoc-->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>2.9.1</version>
                <configuration>
                    <aggregate>true</aggregate>
                    <links>
                        <link>http://download.oracle.com/javase/1.5.0/docs/api/</link>
                    </links>
                </configuration>
                <reportSets>
                    <reportSet>
                        <reports><!-- select non-aggregate reports -->
                            <report>javadoc</report>
                        </reports>
                    </reportSet>
                </reportSets>
            </plugin>
            <!--Info reports-->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-project-info-reports-plugin</artifactId>
                <version>2.7</version>
                <reportSets>
                    <reportSet>
                        <id>default</id>
                        <reports>
                            <report>index</report>
                            <report>summary</report>
                            <report>license</report>
                            <report>modules</report>
                            <report>project-team</report>
                            <report>scm</report>
                            <report>issue-tracking</report>
                            <!--<report>dependencies</report>-->
                            <!--<report>dependency-convergence</report>-->
                            <!--<report>plugins</report>-->
                        </reports>
                    </reportSet>
                </reportSets>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-changes-plugin</artifactId>
                <version>2.8</version>
                <reportSets>
                    <reportSet>
                        <reports>
                            <report>changes-report</report>
                            <!-- <report>github-report</report> -->
                        </reports>
                    </reportSet>
                </reportSets>
            </plugin>
        </plugins>
    </reporting>

</project>