<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>com.chrylis.groovybeans</groupId>
    <artifactId>groovybeans-toolkit-parent</artifactId>
    <version>0.1.3</version>
    <packaging>pom</packaging>
    <name>GroovyBeans Toolkit</name>
    <description>tools for simplifying beans in Groovy</description>

    <url>https://github.com/chrylis/groovybeans-toolkit</url>
    <licenses>
        <license>
            <name>Apache License 2.0</name>
            <url>http://www.spdx.org/licenses/Apache-2.0</url>
        </license>
    </licenses>
    <scm>
        <url>https://github.com/chrylis/groovybeans-toolkit</url>
        <connection>scm:git:git@github.com:chrylis/groovybeans-toolkit.git</connection>
    </scm>

    <developers>
        <developer>
            <id>chrylis@gmail.com</id>
            <name>Christopher Smith</name>
            <email>chrylis@gmail.com</email>
        </developer>
    </developers>

    <distributionManagement>
        <snapshotRepository>
            <id>sonatype-nexus-snapshots</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
        <repository>
            <id>sonatype-nexus-staging</id>
            <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
    </distributionManagement>

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

        <groovy.version>2.5.2</groovy.version>

        <javax.persistence.version>2.1.0</javax.persistence.version>
    </properties>

    <modules>
        <module>groovybeans-annotations</module>
        <module>groovybeans-examples</module>
    </modules>

    <dependencies>
        <dependency>
            <groupId>org.codehaus.groovy</groupId>
            <artifactId>groovy-all</artifactId>
            <version>${groovy.version}</version>
            <type>pom</type>
            <scope>provided</scope>
            <exclusions>
                <exclusion>
                    <groupId>org.codehaus.groovy</groupId>
                    <artifactId>groovy-junit5</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.codehaus.groovy</groupId>
                    <artifactId>groovy-testng</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
    </dependencies>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>com.chrylis.groovybeans</groupId>
                <artifactId>groovybeans-annotations</artifactId>
                <version>${project.version}</version>
            </dependency>

            <dependency>
                <groupId>org.eclipse.persistence</groupId>
                <artifactId>javax.persistence</artifactId>
                <version>${javax.persistence.version}</version>
                <scope>provided</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <configuration>
                        <release>${java.version}</release>
                        <source>${java.version}</source>
                        <target>${java.version}</target>
                    </configuration>
                </plugin>

                <plugin>
                    <groupId>org.codehaus.gmavenplus</groupId>
                    <artifactId>gmavenplus-plugin</artifactId>
                    <version>1.6.1</version>
                    <executions>
                        <execution>
                            <goals>
                                <goal>addSources</goal>
                                <goal>addTestSources</goal>
                                <goal>compile</goal>
                                <goal>compileTests</goal>
                                <goal>groovydoc</goal>
                            </goals>
                        </execution>
                        <execution>
                            <id>groovydoc</id>
                            <phase>prepare-package</phase>
                            <goals>
                                <goal>groovydoc</goal>
                            </goals>
                            <configuration>
                                <groovyDocOutputDirectory>${project.build.directory}/apidocs</groovyDocOutputDirectory>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>

                <plugin>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <configuration>
                        <includes>
                            <include>**/*Test.java</include>
                            <include>**/*Tests.java</include>
                            <include>**/*TestCase.java</include>
                            <include>**/*Spec.java</include>
                        </includes>
                    </configuration>
                </plugin>

                <plugin>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>2.6</version>
                    <configuration>
                        <excludes>
                            <exclude>**/rebel.xml</exclude>
                        </excludes>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>

        <plugins>
            <plugin>
                <artifactId>maven-source-plugin</artifactId>
                <version>3.0.1</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar-no-fork</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>2.10.3</version>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <!-- only run the signing steps when actually deploying to Central -->
    <!-- add -DperformRelease to the mvn deploy command -->
    <profiles>
        <profile>
            <id>release-sign-artifacts</id>
            <activation>
                <property>
                    <name>performRelease</name>
                    <value>true</value>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>1.6</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
