<?xml version="1.0" encoding="UTF-8"?>
<!--

    Copyright (C) 2010-2012, FuseSource Corp.  All rights reserved.

        http://fusesource.com

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

        http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

-->

<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>org.fusesource.mqtt-client</groupId>
    <artifactId>mqtt-client-project</artifactId>
    <version>1.10</version>
  </parent>
  
  
  <groupId>org.fusesource.mqtt-client</groupId>
  <artifactId>mqtt-client-java1.4-uber</artifactId>
  <version>1.10</version>
  
  <name>${project.artifactId}</name>
  <description>
      The ${project.artifactId} module is a Java 1.4 compatible version
      of the mqtt-client uber jar file.
  </description>
  
  <dependencies>

    <dependency>
      <groupId>org.osgi</groupId>
      <artifactId>org.osgi.core</artifactId>
      <version>${osgi-version}</version>
      <optional>true</optional>
    </dependency>
    <dependency>
      <groupId>org.osgi</groupId>
      <artifactId>org.osgi.compendium</artifactId>
      <version>${osgi-version}</version>
      <optional>true</optional>
    </dependency>
    <dependency>
      <groupId>asm</groupId>
      <artifactId>asm-tree</artifactId>
      <version>${asm-version}</version>
      <optional>true</optional>
    </dependency>

  </dependencies>

  <build>
    <plugins>
      
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <version>2.4</version>
        <executions>
          <execution>
            <id>unpack</id>
            <phase>process-resources</phase>
            <goals>
              <goal>unpack</goal>
            </goals>
            <configuration>
              <artifactItems>
                <artifactItem>
                  <groupId>org.fusesource.mqtt-client</groupId>
                  <artifactId>mqtt-client</artifactId>
                  <version>${project.version}</version>
                  <classifier>uber</classifier>
                  <type>jar</type>
                  <overWrite>true</overWrite>
                  <outputDirectory>${project.build.directory}/classes</outputDirectory>
                </artifactItem>
                <artifactItem>
                  <groupId>net.sf.retrotranslator</groupId>
                  <artifactId>retrotranslator-runtime</artifactId>
                  <version>1.2.9</version>
                  <type>jar</type>
                  <overWrite>true</overWrite>
                  <outputDirectory>${project.build.directory}/classes</outputDirectory>
                </artifactItem>
                <artifactItem>            
                  <groupId>backport-util-concurrent</groupId>
                  <artifactId>backport-util-concurrent</artifactId>
                  <version>3.1</version>
                  <type>jar</type>
                  <overWrite>true</overWrite>
                  <outputDirectory>${project.build.directory}/classes</outputDirectory>
                </artifactItem>
              </artifactItems>              
              <overWriteReleases>true</overWriteReleases>
              <overWriteSnapshots>true</overWriteSnapshots>
            </configuration>
          </execution>
        </executions>
      </plugin>      
      
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>retrotranslator-maven-plugin</artifactId>
        <version>1.0-alpha-4</version>
        <executions>
          <execution>
            <phase>compile</phase>
            <goals>
              <goal>translate</goal>
            </goals>
            <configuration>
              <filesets>
                <fileset>
                  <directory>${project.build.directory}/classes</directory>
                  <includes>
                    <include>**/*.class</include>
                  </includes>
                </fileset>
              </filesets>
              <advanced>true</advanced>
              <verify>false</verify>
              <verifyClasspath>
                <element>${java14.rt.jar}</element>
              </verifyClasspath> 
            </configuration>
          </execution>
        </executions>
  	     <dependencies>
    	    <dependency>
            <groupId>net.sf.retrotranslator</groupId>
      		<artifactId>retrotranslator-transformer</artifactId>
      		<version>1.2.9</version>
          </dependency>
  	     </dependencies>
      </plugin>
      
      <plugin>
        <groupId>com.github.wvengen</groupId>
        <artifactId>proguard-maven-plugin</artifactId>
        <version>2.0.5</version>
        <dependencies>
           <dependency>
               <groupId>net.sf.proguard</groupId>
               <artifactId>proguard-base</artifactId>
               <version>4.8</version>
               <scope>runtime</scope>
           </dependency>
        </dependencies>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>proguard</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <proguardVersion>4.8</proguardVersion>
          <injar>${project.build.finalName}.jar</injar>
          <outjar>${project.build.finalName}.jar</outjar>          
          <libs>
            <lib>${rt.jar.path}</lib>
            <lib>${jsse.jar.path}</lib>
          </libs>
          <obfuscate>false</obfuscate>
          <options>
            <option>-dontoptimize</option>
            <option>-keep class org.fusesource.mqtt.** { *; }</option>
          </options>
        </configuration>
      </plugin>
      
    </plugins>
  </build>
  
</project>
