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

    <parent>
        <groupId>org.gephi</groupId>
        <artifactId>gephi-plugin-parent</artifactId>
        <version>0.11.4</version>
    </parent>

    <artifactId>gephi-plugins-tests</artifactId>
    <version>1.2.0</version>

    <name>gephi-plugins-tests</name>
    <description>Integration tests library to run against Gephi Plugins</description>
    <url>https://github.com/gephi/gephi-plugins-tests</url>

    <!-- SCM -->
    <scm>
        <connection>scm:git:git://github.com/gephi/gephi-plugins-tests.git</connection>
        <developerConnection>scm:git:git@github.com:gephi/gephi-plugins-tests.git</developerConnection>
        <url>https://github.com/gephi/gephi-plugins-tests</url>
    </scm>

    <!-- License -->
    <licenses>
        <license>
            <name>Apache 2.0</name>
            <url>http://www.opensource.org/licenses/Apache-2.0</url>
            <comments>Apache License, Version 2.0</comments>
        </license>
    </licenses>

    <!-- Developers -->
    <developers>
        <developer>
            <id>mbastian</id>
            <name>Mathieu Bastian</name>
            <email>mathieu.bastian@gephi.org</email>
        </developer>
    </developers>

    <!-- Dependencies -->
    <dependencies>
        <dependency>
            <groupId>org.netbeans.api</groupId>
            <artifactId>org-netbeans-modules-nbjunit</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.gephi</groupId>
            <artifactId>project-api</artifactId>
        </dependency>
        <dependency>
            <groupId>org.gephi</groupId>
            <artifactId>graph-api</artifactId>
        </dependency>
        <dependency>
            <groupId>org.gephi</groupId>
            <artifactId>layout-api</artifactId>
        </dependency>
        <dependency>
            <groupId>org.gephi</groupId>
            <artifactId>statistics-api</artifactId>
        </dependency>
        <dependency>
            <groupId>org.gephi</groupId>
            <artifactId>utils-longtask</artifactId>
        </dependency>
        <dependency>
            <groupId>org.netbeans.api</groupId>
            <artifactId>org-openide-util</artifactId>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>project-api</artifactId>
            <type>test-jar</type>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>graph-api</artifactId>
            <type>test-jar</type>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.gephi</groupId>
            <artifactId>io-importer-api</artifactId>
            <type>test-jar</type>
            <scope>compile</scope>
        </dependency>
        <!-- Tests -->
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>layout-plugin</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>statistics-plugin</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>statistics-plugin-ui</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>3.4.0</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>3.12.0</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-gpg-plugin</artifactId>
                    <version>3.2.8</version>
                </plugin>
                <plugin>
                    <groupId>org.sonatype.central</groupId>
                    <artifactId>central-publishing-maven-plugin</artifactId>
                    <version>0.12.0</version>
                    <extensions>true</extensions>
                </plugin>
            </plugins>
        </pluginManagement>

        <plugins>
            <!-- Override from parent pom: this is a plain library jar, not an NBM module,
                 so there is no generated NetBeans manifest to point the jar plugin at -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <configuration combine.self="override"/>
                <executions>
                    <!-- The contract tests (e.g. LayoutContractTest) are the actual published
                         content: package them as a proper test-jar for consumers to depend on -->
                    <execution>
                        <id>default-test-jar</id>
                        <phase>package</phase>
                        <goals>
                            <goal>test-jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <!-- Maven central -->
            <plugin>
                <groupId>org.sonatype.central</groupId>
                <artifactId>central-publishing-maven-plugin</artifactId>
                <extensions>true</extensions>
                <configuration>
                    <publishingServerId>central</publishingServerId>
                    <autoPublish>true</autoPublish>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <!-- Release profile-->
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <!-- Sources artifact -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <executions>
                            <!-- All the actual content lives in src/test/java, so package
                                 that (via test-jar-no-fork) but relabel it as the "sources"
                                 classifier Central expects for the main artifact -->
                            <execution>
                                <id>attach-sources</id>
                                <goals>
                                    <goal>test-jar-no-fork</goal>
                                </goals>
                                <configuration>
                                    <classifier>sources</classifier>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>

                    <!-- GPG Signed Components -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <gpgArguments>
                                <arg>--pinentry-mode</arg>
                                <arg>loopback</arg>
                            </gpgArguments>
                        </configuration>
                    </plugin>

                    <!-- Javadoc jar: all the actual content lives in src/test/java (this
                         project's "main" is deliberately empty), so point javadoc there;
                         Central requires a "javadoc"-classified artifact regardless -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <configuration>
                            <doclint>none</doclint>
                            <sourcepath>${project.build.testSourceDirectory}</sourcepath>
                        </configuration>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
