<?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>
    <artifactId>events-api</artifactId>
    <groupId>com.dukescript.events</groupId>
    <version>0.4</version>
    <name>DukeScript Events</name>
    <url>http://dukescript.com</url>

    <packaging>bundle</packaging>
    <properties>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <publicPackages>com.dukescript.api.events</publicPackages>
        <net.java.html.version>1.5.1</net.java.html.version>
        <bck2brwsr.version>0.30</bck2brwsr.version>
        <license>COPYING</license>
    </properties>
    <scm>
        <connection>scm:git:https://github.com/dukescript/dukescript-events.git</connection>
        <url>https://github.com/dukescript/dukescript-events.git</url>
        <developerConnection>scm:git:https://github.com/dukescript/dukescript-events.git</developerConnection>
        <tag>release-${releaseVersion}</tag>
    </scm>
    <description>A Java API for receiving events from a HTML Element in DukeScript.</description>
    <developers>
        <developer>
            <id>monacotoni</id>
            <name>Anton Epple</name>
            <email>toni.epple@dukescript.com</email>
            <organization>Dukehoff GmbH</organization>
            <organizationUrl>http://www.dukescript.com</organizationUrl>
            <roles>
                <role>Project-Administrator</role>
                <role>Developer</role>
            </roles>
            <timezone>+1</timezone>
        </developer>
    </developers>
    
    <licenses>
        <license>
            <name>MIT</name>
            <url>https://opensource.org/licenses/MIT</url>
            <comments>
                Events API is free to use with the MIT license.
            </comments>
        </license>
    </licenses>
    <repositories>
        <repository>
            <id>netbeans</id>
            <name>NetBeans</name>
            <url>http://bits.netbeans.org/maven2/</url>
        </repository>
    </repositories>
    <distributionManagement>
        <snapshotRepository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
    </distributionManagement>

    <build>
        <plugins>
            <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>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <version>2.4</version>
                <configuration>
                    <localCheckout>true</localCheckout>
                    <pushChanges>false</pushChanges>
                    <useReleaseProfile>false</useReleaseProfile>
                    <arguments>-Pjvnet-release -Pgpg</arguments>
                    <tag>release-${releaseVersion}</tag>
                </configuration>
            </plugin>      
            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <version>2.5.3</version>
                <extensions>true</extensions>
                <configuration>
                    <instructions>
                        <Eclipse-BuddyPolicy>dependent</Eclipse-BuddyPolicy>
                    </instructions>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>2.3.2</version>
                <configuration>
                    <source>1.6</source>
                    <target>1.6</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.netbeans.html</groupId>
                <artifactId>html4j-maven-plugin</artifactId>
                <version>${net.java.html.version}</version>
                <executions>
                    <execution>
                        <id>js-classes</id>
                        <goals>
                            <goal>process-js-annotations</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apidesign.bck2brwsr</groupId>
                <artifactId>bck2brwsr-maven-plugin</artifactId>
                <version>${bck2brwsr.version}</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>library</goal>
                        </goals>
                        <configuration>
                            <ignoreBootClassPath>false</ignoreBootClassPath>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-failsafe-plugin</artifactId>
                <version>2.18.1</version>
                <executions>
                    <execution>
                        <phase>verify</phase>
                        <goals>
                            <goal>integration-test</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>2.9</version>
                <configuration>
                    <subpackages>${publicPackages}</subpackages>
                    <skip>false</skip>
                    <excludePackageNames>com.dukescript.impl.*</excludePackageNames>
                    <groups>
                        <group>
                            <title>Events for DukeScript</title>
                            <packages>com.dukescript.api.events</packages>
                        </group>                       
                    </groups>
                    <links>
                        <link>https://seleniumhq.github.io/selenium/docs/api/java/</link>
                    </links>
                </configuration>
            </plugin>
        </plugins>
    </build>
    <dependencies>
        <dependency>
            <groupId>org.netbeans.html</groupId>
            <artifactId>net.java.html.boot</artifactId>
            <version>${net.java.html.version}</version>
            <type>jar</type>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.netbeans.api</groupId>
            <artifactId>org-openide-util-lookup</artifactId>
            <version>RELEASE80</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.dukescript.api</groupId>
            <artifactId>junit-browser-runner</artifactId>
            <version>0.9</version>
            <scope>test</scope>
            <type>jar</type>
        </dependency>
        <dependency>
            <groupId>org.netbeans.html</groupId>
            <artifactId>net.java.html.boot.fx</artifactId>
            <version>${net.java.html.version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>
    <profiles> 
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>javadoc</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                                <phase>prepare-package</phase>
                            </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>
        <profile>
            <id>license</id>
            <activation>
                <property>
                    <name>!skipLicenses</name>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>license-maven-plugin</artifactId>
                        <version>1.16</version>
                        <configuration>
                            <inceptionYear>2018</inceptionYear>
                            <organizationName>Dukehoff GmbH</organizationName>
                            <licenseName>mit</licenseName>
                            <failOnMissingHeader>true</failOnMissingHeader>
                            <descriptionTemplate>src/license/header.txt</descriptionTemplate>
                            <roots>
                                <root>src</root>
                            </roots>  
                        </configuration>
                        <executions>
                            <execution>
                                <id>first</id>
                                <goals>
                                    <goal>update-file-header</goal>
                                </goals>
                                <phase>process-sources</phase>
                                <configuration>
                                    <licenseName>mit</licenseName>
                                    <roots>
                                        <root>src</root>
                                    </roots>
                                </configuration>
                            </execution>
                            <execution>
                                <phase>verify</phase>
                                <goals>
                                    <goal>check-file-header</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    
    </profiles>
</project>