<?xml version="1.0" encoding="UTF-8"?>
<!--
  #%L
  DukeScript Libraries - a library from the DukeScript project.
  Visit http://dukescript.com for support and commercial license.
  %%
  Copyright (C) 2016 Dukehoff GmbH
  %%
  This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0
  and Eclipse Distribution License v. 1.0 which accompanies this distribution.
  The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
  and the Eclipse Distribution License is available at
  http://www.eclipse.org/org/documents/edl-v10.php.
  #L%
  -->

<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.dukescript.api</groupId>
    <artifactId>junit-browser-runner</artifactId>
    <version>0.9</version>
    <name>JUnit Browser Runner</name>
    <packaging>bundle</packaging>
    <description>
        JUnit extension that provides a runner to be used with
        @RunWith annotation that executes DukeScript tests in
        a browser.
    </description>
    <url>http://dukescript.com</url>

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

    <repositories>
        <repository>
            <id>snapshots</id>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
            <releases>
                <enabled>false</enabled>
            </releases>
            <url>https://maven.java.net/content/repositories/snapshots/</url>
        </repository>
    </repositories>
    <pluginRepositories>
        <pluginRepository>
            <id>snapshots</id>
            <url>https://maven.java.net/content/repositories/snapshots/</url>
            <releases>
                <enabled>false</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </pluginRepository>
    </pluginRepositories>

    <licenses>
        <license>
            <name>Eclipse Public License 1.0</name>
            <url>http://www.eclipse.org/legal/epl-v10.html</url>
            <distribution>repo</distribution>
            <comments>
                Keeping the same license as JUnit4.12
            </comments>
        </license>
    </licenses>
    <scm>
        <connection>scm:git:https://github.com/dukescript/junit-browser-runner.git</connection>
        <url>https://github.com/dukescript/junit-browser-runner.git</url>
        <developerConnection>scm:git:https://github.com/dukescript/junit-browser-runner.git</developerConnection>
        <tag>release-${releaseVersion}</tag>
    </scm>
    <distributionManagement>
        <snapshotRepository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
    </distributionManagement>

    <properties>
        <net.java.html.version>1.3</net.java.html.version>
        <bck2brwsr.version>0.19</bck2brwsr.version>
        <maven.compiler.source>1.7</maven.compiler.source>
        <maven.compiler.target>1.7</maven.compiler.target>
        <netbeans.compile.on.save>none</netbeans.compile.on.save>
    </properties>
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>2.5.1</version>
                <configuration>
                    <source>1.7</source>
                    <target>1.7</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <version>2.3.7</version>
                <configuration>
                    <instructions>
                        <Bundle-Name>${project.artifactId}</Bundle-Name>
                        <Bundle-SymbolicName>${project.groupId}.${project.artifactId}</Bundle-SymbolicName>
                        <Bundle-Description>${project.name}</Bundle-Description>
                        <Export-Package>net.java.html.junit</Export-Package>
                    </instructions>
                </configuration>
                <extensions>true</extensions>
            </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>
                    <execution>
                        <id>test-classes</id>
                        <phase>process-test-classes</phase>
                        <goals>
                            <goal>process-js-annotations</goal>
                        </goals>
                        <configuration>
                            <classes>${project.build.directory}/test-classes</classes>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.18.1</version>
                <configuration>
                    <junitArtifactName>com.dukescript.api:junit-osgi</junitArtifactName>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-failsafe-plugin</artifactId>
                <version>2.19.1</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>integration-test</goal>
                            <goal>verify</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <junitArtifactName>com.dukescript.api:junit-osgi</junitArtifactName>
                    <includes>
                        <include>**/*Test</include>
                    </includes>
                    <systemProperties>
                        <vmtest.precompiled>.*</vmtest.precompiled>
                    </systemProperties>
                    <additionalClasspathElements>
                        <additionalClasspathElement>${project.build.directory}/${project.build.finalName}-bck2brwsr.jar</additionalClasspathElement>
                    </additionalClasspathElements>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apidesign.bck2brwsr</groupId>
                <artifactId>bck2brwsr-maven-plugin</artifactId>
                <version>${bck2brwsr.version}</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>library</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <ignoreBootClassPath>false</ignoreBootClassPath>
                    <aotDeps>
                        <aotDep>com.dukescript.api:junit-osgi</aotDep>
                        <aotDep>org.apidesign.bck2brwsr:launcher.http</aotDep>
                    </aotDeps>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.netbeans.tools</groupId>
                <artifactId>sigtest-maven-plugin</artifactId>
                <version>1.0</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>generate</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <packages>net.java.html.junit</packages>
                </configuration>
            </plugin>
        </plugins>
    </build>
    <dependencies>
        <dependency>
            <groupId>com.dukescript.api</groupId>
            <artifactId>junit-osgi</artifactId>
            <version>4.12</version>
        </dependency>
        <dependency>
            <groupId>org.netbeans.html</groupId>
            <artifactId>net.java.html</artifactId>
            <version>${net.java.html.version}</version>
            <type>jar</type>
        </dependency>
        <dependency>
            <groupId>org.netbeans.html</groupId>
            <artifactId>net.java.html.boot</artifactId>
            <version>${net.java.html.version}</version>
            <type>jar</type>
        </dependency>

        <!-- need to be included by the user to turn bck2brwsr support on -->
        <dependency>
            <groupId>org.apidesign.bck2brwsr</groupId>
            <artifactId>launcher.http</artifactId>
            <version>${bck2brwsr.version}</version>
            <type>jar</type>
            <scope>provided</scope>
        </dependency>

        <!-- these libraries are made available to simplify configuration -->
        <dependency>
            <groupId>org.apidesign.bck2brwsr</groupId>
            <artifactId>emul</artifactId>
            <classifier>rt</classifier>
            <version>${bck2brwsr.version}</version>
            <type>jar</type>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.apidesign.bck2brwsr</groupId>
            <artifactId>emul</artifactId>
            <classifier>bck2brwsr</classifier>
            <version>${bck2brwsr.version}</version>
            <type>jar</type>
            <scope>runtime</scope>
        </dependency>

        <!-- only needed by a test -->
        <dependency>
            <groupId>org.netbeans.html</groupId>
            <artifactId>net.java.html.boot.fx</artifactId>
            <version>${net.java.html.version}</version>
            <type>jar</type>
            <scope>test</scope>
        </dependency>
    </dependencies>
    <profiles>
        <profile>
            <id>junit-release</id>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>1.6</version>
                        <executions>
                            <execution>
                                <id>gpg-sign</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <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>
        </profile>
    </profiles>
</project>
