<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/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>io.venuu</groupId>
        <artifactId>vuu-parent</artifactId>
        <version>0.201</version>
    </parent>

    <artifactId>vuu-ui</artifactId>
    <name>vuu-ui</name>
    <inceptionYear>2013</inceptionYear>
    <packaging>jar</packaging>

    <dependencies>
        <dependency>
            <groupId>org.scala-lang</groupId>
            <artifactId>scala-library</artifactId>
            <version>${scala.version}</version>
        </dependency>

        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.13.2</version>
            <scope>test</scope>
        </dependency>

    </dependencies>

    <profiles>
       <!-- this profile is only used when building locally on a machine to deploy to maven -->
        <profile>
            <id>sign-it</id>
            <activation>
                <property>
                    <name>sign</name>
                    <value>true</value>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>3.0.1</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                  <plugin>
                    <artifactId>maven-resources-plugin</artifactId>
                    <version>3.2.0</version>
                    <executions>
                      <execution>
                        <id>copy-resources</id>
                        <!-- here the phase you need -->
                        <phase>process-resources</phase>
                        <goals>
                          <goal>copy-resources</goal>
                        </goals>
                        <configuration>
                          <outputDirectory>${project.basedir}/target/classes/webroot/</outputDirectory>
                          <resources>
                            <resource>
                              <directory>${project.basedir}/packages/app-vuu-example/public</directory>
                              <filtering>false</filtering>
                            </resource>
                          </resources>
                        </configuration>
                      </execution>
                    </executions>
                  </plugin>

                  <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>exec-maven-plugin</artifactId>
                    <version>3.0.0</version>
                    <executions>
                      <execution>
                        <id>step_0_yarn-build</id>
                        <phase>generate-resources</phase>
                        <goals>
                          <goal>exec</goal>
                        </goals>
                      </execution>
                    </executions>
                    <configuration>
                      <!-- this took an insane amount of time, when running the release:prepare command it seems to spawn a new shell within the shell
                           that in turn can't seem to spawn a bash script unless you specify bash as the executable.
                           Grrrrr -->
                      <executable>bash</executable>
                      <!-- optional -->
                      <!--workingDirectory>${project.basedir}/vuu-ui</workingDirectory-->
                      <arguments>
                        <argument>ui-build-commands.sh</argument>
                      </arguments>
                      <!--environmentVariables>
                          <LANG>en_US</LANG>
                      </environmentVariables-->
                    </configuration>
                  </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <build>
        <sourceDirectory>src/main/java</sourceDirectory>
        <testSourceDirectory>src/test/java</testSourceDirectory>
        <plugins>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <!-- version>(whatever version is current)</version-->
                <configuration>
                    <!-- or whatever version you use -->
                    <source>${maven.compiler.source}</source>
                    <target>${maven.compiler.target}</target>
                </configuration>
            </plugin>


            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <!--version>3.0.0-M4</version-->
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>3.3.0</version>

                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>



            <!-- disable surefire -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.7</version>
                <configuration>
                    <!--skipTests>false</skipTests-->
                </configuration>
            </plugin>
            <!-- enable scalatest -->
            <plugin>
                <groupId>org.scalatest</groupId>
                <artifactId>scalatest-maven-plugin</artifactId>
                <version>2.0.0</version>
                <configuration>
                    <!--skipTests>true</skipTests-->
                    <reportsDirectory>${project.build.directory}/surefire-reports</reportsDirectory>
                    <junitxml>.</junitxml>
                    <filereports>test-reports.txt</filereports>
                </configuration>
                <executions>
                    <execution>
                        <id>test</id>
                        <goals>
                            <goal>test</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>


            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>2.2</version>

                <executions>
                    <execution>
                        <goals>
                            <goal>test-jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

        </plugins>
    </build>
    <reporting>
        <plugins>
            <plugin>
                <groupId>org.scala-tools</groupId>
                <artifactId>maven-scala-plugin</artifactId>
                <version>${maven.scala.plugin}</version>
                <configuration>
                    <scalaVersion>${scala.version}</scalaVersion>
                </configuration>
            </plugin>
        </plugins>
    </reporting>
</project>
