<?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/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>com.willwinder.universalgcodesender</groupId>
    <artifactId>ugs-parent</artifactId>
    <version>2.0-SNAPSHOT</version>
  </parent>

  <artifactId>ugs-core</artifactId>
  <version>2.0-SNAPSHOT</version>

  <packaging>jar</packaging>

  <properties>
    <timestamp>${maven.build.timestamp}</timestamp>
    <maven.build.timestamp.format>MMM dd, yyyy</maven.build.timestamp.format>

    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.build.releaseSourceDirectory>release_files</project.build.releaseSourceDirectory>
    <maven.compiler.source>1.8</maven.compiler.source>
    <maven.compiler.target>1.8</maven.compiler.target>
  </properties>

  <dependencies>
    <dependency>
      <groupId>org.jogamp.gluegen</groupId>
      <artifactId>gluegen-rt-main</artifactId>
      <version>${gluegen.version}</version>
    </dependency>
    <dependency>
      <groupId>org.jogamp.jogl</groupId>
      <artifactId>jogl-all-main</artifactId>
      <version>${jogl.version}</version>
    </dependency>
    <dependency>
      <groupId>javax.vecmath</groupId>
      <artifactId>vecmath</artifactId>
      <version>${vecmath.version}</version>
    </dependency>
    <dependency>
      <groupId>javax.media</groupId>
      <artifactId>jmf</artifactId>
      <version>${jmf.version}</version>
    </dependency>
    <dependency>
      <groupId>org.swinglabs</groupId>
      <artifactId>swing-layout</artifactId>
      <version>${swing-layout.version}</version>
    </dependency>
    <dependency>
      <groupId>org.eclipse.jetty</groupId>
      <artifactId>jetty-server</artifactId>
      <version>${jetty.version}</version>
    </dependency>
    <dependency>
      <groupId>com.google.code.gson</groupId>
      <artifactId>gson</artifactId>
      <version>${gson.version}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-lang3</artifactId>
      <version>${commons-lang3.version}</version>
    </dependency>
    <dependency>
      <groupId>commons-io</groupId>
      <artifactId>commons-io</artifactId>
      <version>${commons-io.version}</version>
    </dependency>
    <dependency>
      <groupId>org.scream3r</groupId>
      <artifactId>jssc</artifactId>
      <version>${jssc.version}</version>
    </dependency>
    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava</artifactId>
      <version>${guava.version}</version>
    </dependency>
    <dependency>
      <groupId>com.miglayout</groupId>
      <artifactId>miglayout</artifactId>
      <version>${miglayout.version}</version>
    </dependency>

    <!-- PendantUI -->
    <dependency>
      <groupId>net.glxn</groupId>
      <artifactId>qrgen</artifactId>
      <version>${qrgen.version}</version>
    </dependency>
    <dependency>
      <groupId>com.google.zxing</groupId>
      <artifactId>javase</artifactId>
      <version>${zxing.version}</version>
    </dependency>
    <dependency>
      <groupId>com.google.zxing</groupId>
      <artifactId>core</artifactId>
      <version>${zxing.version}</version>
    </dependency>
    <dependency>
      <groupId>org.squirrelframework</groupId>
      <artifactId>squirrel-foundation</artifactId>
      <version>${ugs.squirrel.version}</version>
    </dependency>


    <!-- ************************* -->
    <!-- *** TEST dependencies ***-->

    <dependency>
      <groupId>org.easymock</groupId>
      <artifactId>easymock</artifactId>
      <version>3.4</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <!-- ================================================== -->
    <!-- = Change default maven src dir to match Netbeans = -->
    <!-- ================================================== -->
    <sourceDirectory>src/</sourceDirectory>
    <testSourceDirectory>test/</testSourceDirectory>

    <testResources>
      <testResource>
        <directory>${project.basedir}/test/resources</directory>
      </testResource>
    </testResources>


    <resources>
      <!-- PendantUI -->
      <resource>
        <directory>src</directory>
        <includes>
          <include>resources/**</include>
        </includes>
      </resource>
      <!--
      <resource>
        <targetPath>${project.build.outputDirectory}/com/willwinder/universalgcodesender/il8n</targetPath>
        <directory>src/com/willwinder/universalgcodesender/il8n</directory>
        <includes>
          <include>MessagesBundle.*</include>
        </includes>
      </resource>
      -->
      <resource>
        <directory>src</directory>
        <filtering>true</filtering>
        <includes>
          <include>resources/build.properties</include>
        </includes>
      </resource>
    </resources>

    <plugins>

      <plugin>
        <groupId>org.mortbay.jetty</groupId>
        <artifactId>jetty-maven-plugin</artifactId>
        <version>${jetty.version}</version>
        <configuration>
          <stopKey>t8qtoU5R8ny6nYqv</stopKey>
          <stopPort>9393</stopPort>
          <scanIntervalSeconds>0</scanIntervalSeconds>
          <useTestClasspath>true</useTestClasspath>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <version>2.5</version>
        <configuration>
          <archive>
            <manifest>
              <mainClass>com.willwinder.universalgcodesender.MainWindow</mainClass>
              <addDefaultImplementationEntries/>
            </manifest>
          </archive>
        </configuration>
      </plugin>

      <!-- Configure the fat-jar -->
      <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>
              <finalName>UniversalGcodeSender</finalName>
              <transformers>
                <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
                <transformer implementation="org.apache.maven.plugins.shade.resource.IncludeResourceTransformer"/>
              </transformers>
              <filters>
                <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>

      <!-- Generate the zip file. -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-assembly-plugin</artifactId>
        <version>2.5.3</version>
        <configuration>
          <finalName>UniversalGcodeSender</finalName>
          <appendAssemblyId>false</appendAssemblyId>
          <descriptors>
            <descriptor>src/assembly/assembly.xml</descriptor>
          </descriptors>
        </configuration>
      </plugin>

      <!-- Code coverage -->
      <plugin>
        <groupId>org.jacoco</groupId>
        <artifactId>jacoco-maven-plugin</artifactId>
        <version>0.7.5.201505241946</version>
        <executions>
          <execution>
            <goals>
              <goal>prepare-agent</goal>
            </goals>
          </execution>
          <execution>
            <id>report</id>
            <phase>test</phase>
            <goals>
              <goal>report</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

    </plugins>
  </build>

  <reporting>
     <plugins>
        <plugin>
           <groupId>org.codehaus.mojo</groupId>
           <artifactId>cobertura-maven-plugin</artifactId>
           <version>${cobertura.version}</version>
           <configuration>
               <formats>
                   <format>xml</format>
               </formats>
           </configuration>
        </plugin>
      </plugins>
   </reporting>
</project>
