<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>io.live4</groupId>
    <artifactId>live4api3</artifactId>
    <!-- READ THISE BEFORE UPDATING VERSION http://semver.org/ -->
    <version>3.5.0-beta9-SNAPSHOT</version>
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <stjs.version>3.3.2</stjs.version>
        <stjs.plugin.version>3.3.2</stjs.plugin.version>
        <retrolambda.plugin.version>2.3.0</retrolambda.plugin.version>
    </properties>
    <scm>
        <url>https://github.com/videogorillas/live4api</url>
        <connection>scm:git:https://github.com/videogorillas/live4api.git</connection>
        <developerConnection>scm:git:https://github.com/videogorillas/live4api.git</developerConnection>
        <tag>live4api3-3.6.0</tag>
    </scm>
    <repositories>
        <repository>
            <id>vg-corporate-repo</id>
            <url>https://kote.videogorillas.com/m2repo/</url>
        </repository>
    </repositories>
    
    <profiles>
        <profile>
            <id>jsbuild-dev</id>
            <activation>
                <file>
                    <exists>.settings/org.eclipse.core.resources.prefs</exists>
                </file>
            </activation>
            <properties>
                <npm.phase>none</npm.phase>
                <grunt.phase>none</grunt.phase>
                <!--<karma.phase>none</karma.phase>-->
            </properties>
        </profile>

        <profile>
            <id>jsbuild-prod</id>
            <activation>
                <activeByDefault>true</activeByDefault>
                <property>
                    <name>env</name>
                    <value>prod</value>
                </property>
            </activation>
            <properties>
                <npm.phase>generate-resources</npm.phase>
                <grunt.phase>process-classes</grunt.phase>
                <!--<karma.phase>none</karma.phase>-->
            </properties>
        </profile>
    </profiles>
    <build>
        <extensions>
            <extension>
                <groupId>org.apache.maven.wagon</groupId>
                <artifactId>wagon-ssh-external</artifactId>
                <version>2.10</version>
            </extension>
        </extensions>
        <plugins>
            <plugin>
                <groupId>org.st-js</groupId>
                <artifactId>stjs-maven-plugin</artifactId>
                <version>${stjs.plugin.version}</version>
                <executions>
                    <execution>
                        <id>stjs main</id>
                        <goals>
                            <goal>generate</goal>
                            <goal>generate-test</goal>
                        </goals>
                        <configuration>
                            <pack>true</pack>
                            <generateSourceMap>true</generateSourceMap>
                            <generatedSourcesDirectory>target/classes</generatedSourcesDirectory>
                        </configuration>
                    </execution>
                    <!-- if you use the JUnit runner -->
                    <execution>
                        <id>test</id>
                        <goals>
                            <goal>generate-test</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <includes>
                        <include>io/live4/js/**/*.java</include>
                        <include>io/live4/api1/**/*.java</include>
                        <include>io/live4/api2/**/*.java</include>
                        <include>io/live4/api3/**/*.java</include>
                        <include>io/live4/model/**/*.java</include>
                    </includes>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>2.10.3</version>
                <configuration>
                    <additionalparam>-Xdoclint:none</additionalparam>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-deploy-plugin</artifactId>
                <version>2.8.2</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>2.4</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>3.0.0</version>
                <configuration>
                    <excludes>
                        <exclude>**/*.java</exclude>
                        <exclude>**/*.map</exclude>
                    </excludes>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.3</version>
                <configuration>
                    <encoding>UTF-8</encoding>
                    <source>1.8</source>
                    <target>1.8</target>
                    <meminitial>1024m</meminitial>
                    <maxmem>2048m</maxmem>
                    <compilerArgument>-parameters</compilerArgument>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <version>2.5.3</version>
                <configuration>
                    <autoVersionSubmodules>true</autoVersionSubmodules>
                    <localCheckout>true</localCheckout>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.19.1</version>
                <configuration>
                    <skipAfterFailureCount>1</skipAfterFailureCount>
                </configuration>
            </plugin>
            <plugin>
                <groupId>net.orfjackal.retrolambda</groupId>
                <artifactId>retrolambda-maven-plugin</artifactId>
                <version>${retrolambda.plugin.version}</version>
                <executions>
                    <execution>
                        <id>retrolambda main</id>
                        <phase>compile</phase>
                        <goals>
                            <goal>process-main</goal>
                            <!-- <goal>process-test</goal> -->
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <target>1.7</target>
                    <defaultMethods>true</defaultMethods>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>2.4.1</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                        <configuration>
                            <shadedArtifactAttached>true</shadedArtifactAttached>
                            <shadedClassifierName>uberjar</shadedClassifierName>
                            <transformers>
                                <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
                            </transformers>
                            <filters>
                                <filter>
                                    <artifact>*:*</artifact>
                                    <excludes>
                                        <exclude>**/*.java</exclude>
                                    </excludes>
                                </filter>
                                <filter>
                                    <artifact>*:*</artifact>
                                    <excludes>
                                        <exclude>META-INF/*.SF</exclude>
                                        <exclude>META-INF/*.DSA</exclude>
                                        <exclude>META-INF/*.RSA</exclude>
                                    </excludes>
                                </filter>
                            </filters>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>com.github.eirslett</groupId>
                <artifactId>frontend-maven-plugin</artifactId>
                <version>1.0</version>
                <executions>
                    <execution>
                        <id>install node and npm</id>
                        <goals>
                            <goal>install-node-and-npm</goal>
                        </goals>
                        <configuration>
                            <nodeVersion>v6.5.0</nodeVersion>
                            <npmVersion>3.10.5</npmVersion>
                        </configuration>
                        <phase>${npm.phase}</phase>
                    </execution>
                    <execution>
                        <id>npm install</id>
                        <goals>
                            <goal>npm</goal>
                        </goals>
                        <phase>${npm.phase}</phase>
                        <configuration>
                            <arguments>install</arguments>
                        </configuration>
                    </execution>
                    <execution>
                        <id>grunt default</id>
                        <goals>
                            <goal>grunt</goal>
                        </goals>
                        <phase>${grunt.phase}</phase>
                    </execution>
                    <!--<execution>-->
                        <!--<id>grunt karma</id>-->
                        <!--<goals>-->
                            <!--<goal>grunt</goal>-->
                        <!--</goals>-->
                        <!--<phase>${karma.phase}</phase>-->
                        <!--<configuration>-->
                            <!--<arguments>karma</arguments>-->
                        <!--</configuration>-->
                    <!--</execution>-->
                    <!--<execution>-->
                        <!--<id>karma</id>-->
                        <!--<goals>-->
                            <!--<goal>karma</goal>-->
                        <!--</goals>-->
                        <!--<phase>test</phase>-->
                        <!--<configuration>-->
                            <!--<karmaConfPath>karma.conf.js  &#45;&#45;single-run</karmaConfPath>-->
                        <!--</configuration>-->
                    <!--</execution>-->
                </executions>
            </plugin>
        </plugins>
        <pluginManagement>
            <plugins>
                <!-- configuration for maven plugin 1.0.0 for automatic code generation -->
                <plugin>
                    <groupId>org.eclipse.m2e</groupId>
                    <artifactId>lifecycle-mapping</artifactId>
                    <version>1.0.0</version>
                    <configuration>
                        <lifecycleMappingMetadata>
                            <pluginExecutions>
                                <pluginExecution>
                                    <pluginExecutionFilter>
                                        <groupId>org.st-js</groupId>
                                        <artifactId>
                                            stjs-maven-plugin
                                        </artifactId>
                                        <versionRange>
                                            [${stjs.plugin.version},)
                                        </versionRange>
                                        <goals>
                                            <goal>generate</goal>
                                            <goal>generate-test</goal>
                                        </goals>
                                    </pluginExecutionFilter>
                                    <action>
                                        <execute>
                                            <runOnIncremental>true</runOnIncremental>
                                        </execute>
                                    </action>
                                </pluginExecution>
                                <pluginExecution>
                                    <pluginExecutionFilter>
                                        <groupId>net.orfjackal.retrolambda</groupId>
                                        <artifactId>
                                            retrolambda-maven-plugin
                                        </artifactId>
                                        <versionRange>
                                            [${retrolambda.plugin.version},)
                                        </versionRange>
                                        <goals>
                                            <goal>process-main</goal>
                                            <goal>process-test</goal>
                                        </goals>
                                    </pluginExecutionFilter>
                                    <action>
                                        <execute>
                                            <runOnIncremental>true</runOnIncremental>
                                        </execute>
                                    </action>
                                </pluginExecution>
                            </pluginExecutions>
                        </lifecycleMappingMetadata>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>
    <dependencies>
        <!-- https://mvnrepository.com/artifact/javax.ws.rs/javax.ws.rs-api -->
        <dependency>
            <groupId>javax.ws.rs</groupId>
            <artifactId>javax.ws.rs-api</artifactId>
            <version>2.0.1</version>
        </dependency>
        <dependency>
            <groupId>io.reactivex</groupId>
            <artifactId>rxjava</artifactId>
            <version>1.2.10</version>
        </dependency>
        <dependency>
            <groupId>com.squareup.okhttp</groupId>
            <artifactId>okhttp</artifactId>
            <version>2.7.5</version>
        </dependency>
        <dependency>
            <groupId>com.squareup.okhttp</groupId>
            <artifactId>okhttp-ws</artifactId>
            <version>2.7.5</version>
        </dependency>
        <dependency>
            <groupId>org.st-js</groupId>
            <artifactId>server</artifactId>
            <version>${stjs.version}</version>
        </dependency>
        <dependency>
            <groupId>com.google.code.gson</groupId>
            <artifactId>gson</artifactId>
            <version>2.8.1</version>
        </dependency>
        <dependency>
            <groupId>org.st-js.bridge</groupId>
            <artifactId>html</artifactId>
            <version>5.0.bv30-74</version>
        </dependency>
        <dependency>
            <groupId>com.vg</groupId>
            <artifactId>rxjs-bridge</artifactId>
            <version>4.1.0-22</version>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.12</version>
            <scope>test</scope>
        </dependency>
    </dependencies>
</project>
