Merge branch 'master' of https://github.com/PramodSSImmaneni/incubator-apex-core
diff --git a/apex-app-archetype/src/main/resources/archetype-resources/pom.xml b/apex-app-archetype/src/main/resources/archetype-resources/pom.xml
index a1beaa4..0709a7b 100644
--- a/apex-app-archetype/src/main/resources/archetype-resources/pom.xml
+++ b/apex-app-archetype/src/main/resources/archetype-resources/pom.xml
@@ -237,7 +237,7 @@
     <dependency>
       <groupId>org.apache.apex</groupId>
       <artifactId>malhar-library</artifactId>
-      <version>3.3.0-incubating</version>
+      <version>3.4.0</version>
       <!-- 
            If you know that your application does not need transitive dependencies pulled in by malhar-library,
            uncomment the following to reduce the size of your app package.
diff --git a/apex-conf-archetype/src/main/resources/archetype-resources/pom.xml b/apex-conf-archetype/src/main/resources/archetype-resources/pom.xml
index 624fb0d..4645c77 100644
--- a/apex-conf-archetype/src/main/resources/archetype-resources/pom.xml
+++ b/apex-conf-archetype/src/main/resources/archetype-resources/pom.xml
@@ -29,127 +29,127 @@
 
   <build>
     <plugins>
-       <plugin>
-         <groupId>org.apache.maven.plugins</groupId>
-         <artifactId>maven-eclipse-plugin</artifactId>
-         <version>2.9</version>
-         <configuration>
-           <downloadSources>true</downloadSources>
-         </configuration>
-       </plugin>
-       <plugin>
-         <artifactId>maven-compiler-plugin</artifactId>
-         <version>3.3</version>
-         <configuration>
-           <encoding>UTF-8</encoding>
-           <source>1.7</source>
-           <target>1.7</target>
-           <debug>true</debug>
-           <optimize>false</optimize>
-           <showDeprecation>true</showDeprecation>
-           <showWarnings>true</showWarnings>
-         </configuration>
-       </plugin>
-       <plugin>
-         <artifactId>maven-dependency-plugin</artifactId>
-         <version>2.8</version>
-         <executions>
-           <execution>
-             <id>copy-dependencies</id>
-             <phase>prepare-package</phase>
-             <goals>
-               <goal>copy-dependencies</goal>
-             </goals>
-             <configuration>
-               <outputDirectory>target/deps</outputDirectory>
-               <includeScope>runtime</includeScope>
-             </configuration>
-           </execution>
-           <execution>
-             <id>unpack</id>
-             <phase>package</phase>
-             <goals>
-               <goal>unpack</goal>
-             </goals>
-             <configuration>
-               <artifactItems>
-                 <artifactItem>
-                   <groupId>${project.groupId}</groupId>
-                   <artifactId>${project.artifactId}</artifactId>
-                   <version>${project.version}</version>
-                   <type>jar</type>
-                   <includes>META-INF/MANIFEST.MF</includes>
-                   <outputDirectory>target</outputDirectory>
-                 </artifactItem>
-               </artifactItems>
-             </configuration>
-           </execution>
-         </executions>
-       </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-eclipse-plugin</artifactId>
+        <version>2.9</version>
+        <configuration>
+          <downloadSources>true</downloadSources>
+        </configuration>
+      </plugin>
+      <plugin>
+        <artifactId>maven-compiler-plugin</artifactId>
+        <version>3.3</version>
+        <configuration>
+          <encoding>UTF-8</encoding>
+          <source>1.7</source>
+          <target>1.7</target>
+          <debug>true</debug>
+          <optimize>false</optimize>
+          <showDeprecation>true</showDeprecation>
+          <showWarnings>true</showWarnings>
+        </configuration>
+      </plugin>
+      <plugin>
+        <artifactId>maven-dependency-plugin</artifactId>
+        <version>2.8</version>
+        <executions>
+          <execution>
+            <id>copy-dependencies</id>
+            <phase>prepare-package</phase>
+            <goals>
+              <goal>copy-dependencies</goal>
+            </goals>
+            <configuration>
+              <outputDirectory>target/deps</outputDirectory>
+              <includeScope>runtime</includeScope>
+            </configuration>
+          </execution>
+          <execution>
+            <id>unpack</id>
+            <phase>package</phase>
+            <goals>
+              <goal>unpack</goal>
+            </goals>
+            <configuration>
+              <artifactItems>
+                <artifactItem>
+                  <groupId>${project.groupId}</groupId>
+                  <artifactId>${project.artifactId}</artifactId>
+                  <version>${project.version}</version>
+                  <type>jar</type>
+                  <includes>META-INF/MANIFEST.MF</includes>
+                  <outputDirectory>target</outputDirectory>
+                </artifactItem>
+              </artifactItems>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
 
-       <plugin>
-         <artifactId>maven-assembly-plugin</artifactId>
-         <executions>
-           <execution>
-             <id>conf-package-assembly</id>
-             <phase>package</phase>
-             <goals>
-               <goal>single</goal>
-             </goals>
-             <configuration>
-               <finalName>${project.artifactId}-apexconf</finalName>
-               <appendAssemblyId>false</appendAssemblyId>
-               <descriptors>
-                 <descriptor>src/assemble/confPackage.xml</descriptor>
-               </descriptors>
-               <archiverConfig>
-                 <defaultDirectoryMode>0755</defaultDirectoryMode>
-               </archiverConfig>                  
-               <archive>
-                 <manifestEntries>
-                   <DT-App-Package-Group-Id>${apex.apppackage.groupid}</DT-App-Package-Group-Id>
-                   <DT-App-Package-Name>${apex.apppackage.name}</DT-App-Package-Name>
-                   <DT-App-Package-Min-Version>${apex.apppackage.minversion}</DT-App-Package-Min-Version>
-                   <DT-App-Package-Max-Version>${apex.apppackage.maxversion}</DT-App-Package-Max-Version>
-                   <DT-Conf-Package-Name>${project.artifactId}</DT-Conf-Package-Name>
-                   <DT-Conf-Package-Display-Name>${project.name}</DT-Conf-Package-Display-Name>
-                   <DT-Conf-Package-Description>${project.description}</DT-Conf-Package-Description>
-                   <Class-Path>${apex.appconf.classpath}</Class-Path>
-                   <Files>${apex.appconf.files}</Files>
-                 </manifestEntries>
-               </archive>
-             </configuration>
-           </execution>
-         </executions>
-       </plugin>
+      <plugin>
+        <artifactId>maven-assembly-plugin</artifactId>
+        <executions>
+          <execution>
+            <id>conf-package-assembly</id>
+            <phase>package</phase>
+            <goals>
+              <goal>single</goal>
+            </goals>
+            <configuration>
+              <finalName>${project.artifactId}-apexconf</finalName>
+              <appendAssemblyId>false</appendAssemblyId>
+              <descriptors>
+                <descriptor>src/assemble/confPackage.xml</descriptor>
+              </descriptors>
+              <archiverConfig>
+                <defaultDirectoryMode>0755</defaultDirectoryMode>
+              </archiverConfig>
+              <archive>
+                <manifestEntries>
+                  <DT-App-Package-Group-Id>${apex.apppackage.groupid}</DT-App-Package-Group-Id>
+                  <DT-App-Package-Name>${apex.apppackage.name}</DT-App-Package-Name>
+                  <DT-App-Package-Min-Version>${apex.apppackage.minversion}</DT-App-Package-Min-Version>
+                  <DT-App-Package-Max-Version>${apex.apppackage.maxversion}</DT-App-Package-Max-Version>
+                  <DT-Conf-Package-Name>${project.artifactId}</DT-Conf-Package-Name>
+                  <DT-Conf-Package-Display-Name>${project.name}</DT-Conf-Package-Display-Name>
+                  <DT-Conf-Package-Description>${project.description}</DT-Conf-Package-Description>
+                  <Class-Path>${apex.appconf.classpath}</Class-Path>
+                  <Files>${apex.appconf.files}</Files>
+                </manifestEntries>
+              </archive>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
 
-       <plugin>
-         <artifactId>maven-antrun-plugin</artifactId>
-         <version>1.7</version>
-         <executions>
-           <execution>
-             <phase>package</phase>
-             <configuration>
-               <target>
-                 <move file="${project.build.directory}/${project.artifactId}-apexconf.jar"
-                       tofile="${project.build.directory}/${project.artifactId}.apc" />
-               </target>
-             </configuration>
-             <goals>
-               <goal>run</goal>
-             </goals>
-           </execution>
-         </executions>
-       </plugin>
+      <plugin>
+        <artifactId>maven-antrun-plugin</artifactId>
+        <version>1.7</version>
+        <executions>
+          <execution>
+            <phase>package</phase>
+            <configuration>
+              <target>
+                <move file="${project.build.directory}/${project.artifactId}-apexconf.jar"
+                    tofile="${project.build.directory}/${project.artifactId}.apc"/>
+              </target>
+            </configuration>
+            <goals>
+              <goal>run</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
 
-       <plugin>
-         <groupId>org.apache.maven.plugins</groupId>
-         <artifactId>maven-install-plugin</artifactId>
-         <version>2.5.2</version>
-         <configuration>
-           <skip>true</skip>
-         </configuration>
-       </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-install-plugin</artifactId>
+        <version>2.5.2</version>
+        <configuration>
+          <skip>true</skip>
+        </configuration>
+      </plugin>
 
     </plugins>
   </build>
diff --git a/bufferserver/src/main/java/com/datatorrent/bufferserver/internal/DataList.java b/bufferserver/src/main/java/com/datatorrent/bufferserver/internal/DataList.java
index 2a01102..3f596d9 100644
--- a/bufferserver/src/main/java/com/datatorrent/bufferserver/internal/DataList.java
+++ b/bufferserver/src/main/java/com/datatorrent/bufferserver/internal/DataList.java
@@ -176,21 +176,20 @@
     numberOfInMemBlockPermits.set(MAX_COUNT_OF_INMEM_BLOCKS - 1);
   }
 
-  public void purge(final int baseSeconds, final int windowId)
+  public void purge(final long windowId)
   {
-    final long longWindowId = (long)baseSeconds << 32 | windowId;
     logger.debug("Purging {} from window ID {} to window ID {}", this, Codec.getStringWindowId(first.starting_window),
-        Codec.getStringWindowId(longWindowId));
+        Codec.getStringWindowId(windowId));
 
     int numberOfInMemBlockPurged = 0;
     synchronized (this) {
-      for (Block prev = null, temp = first; temp != null && temp.starting_window <= longWindowId;
+      for (Block prev = null, temp = first; temp != null && temp.starting_window <= windowId;
           prev = temp, temp = temp.next) {
-        if (temp.ending_window > longWindowId || temp == last) {
+        if (temp.ending_window > windowId || temp == last) {
           if (prev != null) {
             first = temp;
           }
-          first.purge(longWindowId);
+          first.purge(windowId);
           break;
         }
         temp.discard(false);
diff --git a/bufferserver/src/main/java/com/datatorrent/bufferserver/server/Server.java b/bufferserver/src/main/java/com/datatorrent/bufferserver/server/Server.java
index 83b50d2..12eed5f 100644
--- a/bufferserver/src/main/java/com/datatorrent/bufferserver/server/Server.java
+++ b/bufferserver/src/main/java/com/datatorrent/bufferserver/server/Server.java
@@ -26,7 +26,6 @@
 import java.nio.channels.SocketChannel;
 import java.util.ArrayList;
 import java.util.Arrays;
-import java.util.HashMap;
 import java.util.Iterator;
 import java.util.Map.Entry;
 import java.util.concurrent.ArrayBlockingQueue;
@@ -169,7 +168,7 @@
     return identity;
   }
 
-  private final HashMap<String, DataList> publisherBuffers = new HashMap<String, DataList>();
+  private final ConcurrentHashMap<String, DataList> publisherBuffers = new ConcurrentHashMap<>(1, 0.75f, 1);
   private final ConcurrentHashMap<String, LogicalNode> subscriberGroups = new ConcurrentHashMap<String, LogicalNode>();
   private final ConcurrentHashMap<String, AbstractLengthPrependerClient> publisherChannels = new ConcurrentHashMap<>();
   private final ConcurrentHashMap<String, AbstractLengthPrependerClient> subscriberChannels = new ConcurrentHashMap<>();
@@ -185,7 +184,7 @@
     if (dl == null) {
       message = ("Invalid identifier '" + request.getIdentifier() + "'").getBytes();
     } else {
-      dl.purge(request.getBaseSeconds(), request.getWindowId());
+      dl.purge((long)request.getBaseSeconds() << 32 | request.getWindowId());
       message = ("Request sent for processing: " + request).getBytes();
     }
 
@@ -199,6 +198,13 @@
     }
   }
 
+  public void purge(long windowId)
+  {
+    for (DataList dataList: publisherBuffers.values()) {
+      dataList.purge(windowId);
+    }
+  }
+
   private void handleResetRequest(ResetRequestTuple request, final AbstractLengthPrependerClient ctx) throws IOException
   {
     DataList dl;
diff --git a/engine/pom.xml b/engine/pom.xml
index a56909e..b82cb29 100644
--- a/engine/pom.xml
+++ b/engine/pom.xml
@@ -163,10 +163,11 @@
       <plugin>
         <artifactId>maven-surefire-plugin</artifactId>
         <configuration>
-          <argLine>-Xmx2048m</argLine>
+          <argLine>-Xmx2048m -XX:MaxPermSize=128m</argLine>
           <systemPropertyVariables>
             <maven.home>${maven.home}</maven.home>
             <maven.multiModuleProjectDirectory>${maven.home}</maven.multiModuleProjectDirectory>
+            <apex.version>${project.version}</apex.version>
           </systemPropertyVariables>
         </configuration>
       </plugin>
diff --git a/engine/src/main/java/com/datatorrent/stram/StreamingAppMasterService.java b/engine/src/main/java/com/datatorrent/stram/StreamingAppMasterService.java
index 1c7c893..43ab743 100644
--- a/engine/src/main/java/com/datatorrent/stram/StreamingAppMasterService.java
+++ b/engine/src/main/java/com/datatorrent/stram/StreamingAppMasterService.java
@@ -105,6 +105,7 @@
 import com.datatorrent.stram.security.StramDelegationTokenManager;
 import com.datatorrent.stram.security.StramUserLogin;
 import com.datatorrent.stram.security.StramWSFilterInitializer;
+import com.datatorrent.stram.util.ConfigUtils;
 import com.datatorrent.stram.util.SecurityUtils;
 import com.datatorrent.stram.webapp.AppInfo;
 import com.datatorrent.stram.webapp.StramWebApp;
@@ -614,7 +615,11 @@
       }
       WebApp webApp = WebApps.$for("stram", StramAppContext.class, appContext, "ws").with(config).start(new StramWebApp(this.dnmgr));
       LOG.info("Started web service at port: " + webApp.port());
-      this.appMasterTrackingUrl = NetUtils.getConnectAddress(webApp.getListenerAddress()).getHostName() + ":" + webApp.port();
+      appMasterTrackingUrl = NetUtils.getConnectAddress(webApp.getListenerAddress()).getHostName() + ":" + webApp.port();
+
+      if (ConfigUtils.isSSLEnabled(config)) {
+        appMasterTrackingUrl = "https://" + appMasterTrackingUrl;
+      }
       LOG.info("Setting tracking URL to: " + appMasterTrackingUrl);
     } catch (Exception e) {
       LOG.error("Webapps failed to start. Ignoring for now:", e);
diff --git a/engine/src/main/java/com/datatorrent/stram/StreamingContainerManager.java b/engine/src/main/java/com/datatorrent/stram/StreamingContainerManager.java
index 092f5a2..d5e5475 100644
--- a/engine/src/main/java/com/datatorrent/stram/StreamingContainerManager.java
+++ b/engine/src/main/java/com/datatorrent/stram/StreamingContainerManager.java
@@ -2171,32 +2171,6 @@
         };
         poolExecutor.submit(r);
       }
-      // delete stream state when using buffer server
-      for (PTOperator.PTOutput out : operator.getOutputs()) {
-        if (!out.isDownStreamInline()) {
-          if (operator.getContainer().bufferServerAddress == null) {
-            // address should be null only for a new container, in which case there should not be a purge request
-            // TODO: logging added to find out how we got here
-            LOG.warn("purge request w/o buffer server address source {} container {} checkpoints {}",
-                out, operator.getContainer(), operator.checkpoints);
-            continue;
-          }
-
-          for (InputPortMeta ipm : out.logicalStream.getSinks()) {
-            StreamCodec<?> streamCodecInfo = StreamingContainerAgent.getStreamCodec(ipm);
-            Integer codecId = plan.getStreamCodecIdentifier(streamCodecInfo);
-            // following needs to match the concat logic in StreamingContainer
-            String sourceIdentifier = Integer.toString(operator.getId()).concat(Component.CONCAT_SEPARATOR).concat(out.portName).concat(Component.CONCAT_SEPARATOR).concat(codecId.toString());
-            // delete everything from buffer server prior to new checkpoint
-            BufferServerController bsc = getBufferServerClient(operator);
-            try {
-              bsc.purge(null, sourceIdentifier, operator.checkpoints.getFirst().windowId - 1);
-            } catch (RuntimeException re) {
-              LOG.warn("Failed to purge {} {}", bsc.addr, sourceIdentifier, re);
-            }
-          }
-        }
-      }
     }
     purgeCheckpoints.clear();
   }
diff --git a/engine/src/main/java/com/datatorrent/stram/client/StramAgent.java b/engine/src/main/java/com/datatorrent/stram/client/StramAgent.java
index 1e38ef2..29de7aa 100644
--- a/engine/src/main/java/com/datatorrent/stram/client/StramAgent.java
+++ b/engine/src/main/java/com/datatorrent/stram/client/StramAgent.java
@@ -204,7 +204,14 @@
     if (info != null) {
       //ws = wsClient.resource("http://" + info.appMasterTrackingUrl).path(WebServices.PATH).path(info.version).path("stram");
       // the filter should convert to the right version
-      ub = UriBuilder.fromUri("http://" + info.appMasterTrackingUrl).path(WebServices.PATH).path(WebServices.VERSION).path("stram");
+      String url;
+      if (!info.appMasterTrackingUrl.startsWith("http://")
+          && !info.appMasterTrackingUrl.startsWith("https://")) {
+        url = "http://" + info.appMasterTrackingUrl;
+      } else {
+        url = info.appMasterTrackingUrl;
+      }
+      ub = UriBuilder.fromUri(url).path(WebServices.PATH).path(WebServices.VERSION).path("stram");
       WebServicesVersionConversion.Converter versionConverter = WebServicesVersionConversion.getConverter(info.version);
       if (versionConverter != null) {
         VersionConversionFilter versionConversionFilter = new VersionConversionFilter(versionConverter);
diff --git a/engine/src/main/java/com/datatorrent/stram/engine/StreamingContainer.java b/engine/src/main/java/com/datatorrent/stram/engine/StreamingContainer.java
index 1953d7a..54b8a6e 100644
--- a/engine/src/main/java/com/datatorrent/stram/engine/StreamingContainer.java
+++ b/engine/src/main/java/com/datatorrent/stram/engine/StreamingContainer.java
@@ -769,7 +769,15 @@
     }
 
     if (rsp.committedWindowId != lastCommittedWindowId) {
+
       lastCommittedWindowId = rsp.committedWindowId;
+
+      if (bufferServer != null) {
+        //  One Window before the committed Window is kept in the Buffer Server, for historical reasons.
+        // Jira for that issue is APEXCORE-479
+        bufferServer.purge(lastCommittedWindowId - 1);
+      }
+
       OperatorRequest nr = null;
       for (Entry<Integer, Node<?>> e : nodes.entrySet()) {
         final Thread thread = e.getValue().context.getThread();
diff --git a/engine/src/main/java/com/datatorrent/stram/util/ConfigUtils.java b/engine/src/main/java/com/datatorrent/stram/util/ConfigUtils.java
index 0275535..9da0b0c 100644
--- a/engine/src/main/java/com/datatorrent/stram/util/ConfigUtils.java
+++ b/engine/src/main/java/com/datatorrent/stram/util/ConfigUtils.java
@@ -68,15 +68,30 @@
     return principal;
   }
 
-  public static String getSchemePrefix(YarnConfiguration conf)
+  public static boolean isSSLEnabled(Configuration conf)
   {
-    if (HttpConfig.Policy.HTTPS_ONLY == HttpConfig.Policy.fromString(conf.get(YarnConfiguration.YARN_HTTP_POLICY_KEY, YarnConfiguration.YARN_HTTP_POLICY_DEFAULT))) {
+    if (HttpConfig.Policy.HTTPS_ONLY == HttpConfig.Policy.fromString(
+        conf.get(YarnConfiguration.YARN_HTTP_POLICY_KEY, YarnConfiguration.YARN_HTTP_POLICY_DEFAULT))) {
+      return true;
+    }
+    return false;
+  }
+
+  public static String getSchemePrefix(Configuration conf)
+  {
+    if (isSSLEnabled(conf)) {
       return "https://";
     } else {
       return "http://";
     }
   }
 
+  @Deprecated
+  public static String getSchemePrefix(YarnConfiguration conf)
+  {
+    return getSchemePrefix((Configuration)conf);
+  }
+
   public static String getYarnLogDir()
   {
     if (yarnLogDir != null) {
diff --git a/engine/src/test/java/com/datatorrent/stram/client/AppPackageTest.java b/engine/src/test/java/com/datatorrent/stram/client/AppPackageTest.java
index 5f16399..9999f01 100644
--- a/engine/src/test/java/com/datatorrent/stram/client/AppPackageTest.java
+++ b/engine/src/test/java/com/datatorrent/stram/client/AppPackageTest.java
@@ -87,7 +87,7 @@
     Assert.assertEquals("com.example", json.getString("appPackageGroupId"));
     Assert.assertEquals("mydtapp", json.getString("appPackageName"));
     Assert.assertEquals("1.0-SNAPSHOT", json.getString("appPackageVersion"));
-    Assert.assertEquals("3.2.0-incubating", json.getString("dtEngineVersion"));
+    Assert.assertEquals(System.getProperty("apex.version", "3.4.0"), json.getString("dtEngineVersion"));
     Assert.assertEquals("lib/*.jar", json.getJSONArray("classPath").getString(0));
 
     JSONObject application = json.getJSONArray("applications").getJSONObject(0);
diff --git a/engine/src/test/java/com/datatorrent/stram/support/StramTestSupport.java b/engine/src/test/java/com/datatorrent/stram/support/StramTestSupport.java
index 7b4bf76..0326b6a 100644
--- a/engine/src/test/java/com/datatorrent/stram/support/StramTestSupport.java
+++ b/engine/src/test/java/com/datatorrent/stram/support/StramTestSupport.java
@@ -29,6 +29,7 @@
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashMap;
+import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
 
@@ -156,8 +157,15 @@
    */
   public static File createAppPackageFile()
   {
-    Assert.assertEquals(0, mavenCli.doMain(new String[] {"clean", "package", "-DskipTests"},
-        workingDirectory, System.out, System.err));
+    final String version = System.getProperty("apex.version");
+    final List<String> params = new LinkedList<>();
+    params.add("clean");
+    params.add("package");
+    params.add("-DskipTests");
+    if (version != null && version.length() > 0) {
+      params.add("-Dapex.version=" + version);
+    }
+    Assert.assertEquals(0, mavenCli.doMain(params.toArray(new String[params.size()]), workingDirectory, System.out, System.err));
     return new File(workingDirectory, "target/mydtapp-1.0-SNAPSHOT.apa");
   }
 
diff --git a/engine/src/test/resources/testAppPackage/mydtapp/pom.xml b/engine/src/test/resources/testAppPackage/mydtapp/pom.xml
index 4ba5870..f8cbb1c 100644
--- a/engine/src/test/resources/testAppPackage/mydtapp/pom.xml
+++ b/engine/src/test/resources/testAppPackage/mydtapp/pom.xml
@@ -33,132 +33,128 @@
 
   <properties>
     <!-- change this if you desire to use a different version of Apex Core -->
-    <apex.version>3.2.0-incubating</apex.version>
+    <apex.version>3.4.0</apex.version>
     <apex.apppackage.classpath>lib/*.jar</apex.apppackage.classpath>
   </properties>
 
   <build>
     <plugins>
-       <plugin>
-         <groupId>org.apache.maven.plugins</groupId>
-         <artifactId>maven-eclipse-plugin</artifactId>
-         <version>2.9</version>
-         <configuration>
-           <downloadSources>true</downloadSources>
-         </configuration>
-       </plugin>
-       <plugin>
-         <artifactId>maven-compiler-plugin</artifactId>
-         <version>2.3.2</version>
-         <configuration>
-           <encoding>UTF-8</encoding>
-           <source>1.6</source>
-           <target>1.6</target>
-           <debug>true</debug>
-           <optimize>false</optimize>
-           <showDeprecation>true</showDeprecation>
-           <showWarnings>true</showWarnings>
-         </configuration>
-       </plugin>
-       <plugin>
-         <artifactId>maven-dependency-plugin</artifactId>
-         <version>2.8</version>
-         <executions>
-           <execution>
-             <id>copy-dependencies</id>
-             <phase>prepare-package</phase>
-             <goals>
-               <goal>copy-dependencies</goal>
-             </goals>
-             <configuration>
-               <outputDirectory>target/deps</outputDirectory>
-               <includeScope>runtime</includeScope>
-             </configuration>
-           </execution>
-           <execution>
-             <id>unpack</id>
-             <phase>package</phase>
-             <goals>
-               <goal>unpack</goal>
-             </goals>
-             <configuration>
-               <artifactItems>
-                 <artifactItem>
-                   <groupId>${project.groupId}</groupId>
-                   <artifactId>${project.artifactId}</artifactId>
-                   <version>${project.version}</version>
-                   <type>jar</type>
-                   <includes>META-INF/MANIFEST.MF</includes>
-                   <outputDirectory>target</outputDirectory>
-                 </artifactItem>
-               </artifactItems>
-             </configuration>
-           </execution>
-         </executions>
-       </plugin>
-
-       <plugin>
-         <artifactId>maven-assembly-plugin</artifactId>
-         <executions>
-           <execution>
-             <id>app-package-assembly</id>
-             <phase>package</phase>
-             <goals>
-               <goal>single</goal>
-             </goals>
-             <configuration>
-               <finalName>${project.artifactId}-${project.version}-apexapp</finalName>
-               <appendAssemblyId>false</appendAssemblyId>
-               <descriptors>
-                 <descriptor>src/assemble/appPackage.xml</descriptor>
-               </descriptors>
-               <archiverConfig>
-                 <defaultDirectoryMode>0755</defaultDirectoryMode>
-               </archiverConfig>                  
-               <archive>
-                 <manifestEntries>
-                   <Class-Path>${apex.apppackage.classpath}</Class-Path>
-                   <DT-Engine-Version>${apex.version}</DT-Engine-Version>
-                   <DT-App-Package-Group-Id>${project.groupId}</DT-App-Package-Group-Id>
-                   <DT-App-Package-Name>${project.artifactId}</DT-App-Package-Name>
-                   <DT-App-Package-Version>${project.version}</DT-App-Package-Version>
-                   <DT-App-Package-Display-Name>${project.name}</DT-App-Package-Display-Name>
-                   <DT-App-Package-Description>${project.description}</DT-App-Package-Description>
-                 </manifestEntries>
-               </archive>
-             </configuration>
-           </execution>
-         </executions>
-       </plugin>
-
-       <plugin>
-         <artifactId>maven-antrun-plugin</artifactId>
-         <version>1.7</version>
-         <executions>
-           <execution>
-             <phase>package</phase>
-             <configuration>
-               <target>
-                 <move file="${project.build.directory}/${project.artifactId}-${project.version}-apexapp.jar"
-                       tofile="${project.build.directory}/${project.artifactId}-${project.version}.apa" />
-               </target>
-             </configuration>
-             <goals>
-               <goal>run</goal>
-             </goals>
-           </execution>
-         </executions>
-       </plugin>
-
-       <plugin>
-         <groupId>org.apache.maven.plugins</groupId>
-         <artifactId>maven-install-plugin</artifactId>
-         <version>2.5.2</version>
-         <configuration>
-           <skip>true</skip>
-         </configuration>
-       </plugin>
-
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-eclipse-plugin</artifactId>
+        <version>2.9</version>
+        <configuration>
+          <downloadSources>true</downloadSources>
+        </configuration>
+      </plugin>
+      <plugin>
+        <artifactId>maven-compiler-plugin</artifactId>
+        <version>2.3.2</version>
+        <configuration>
+          <encoding>UTF-8</encoding>
+          <source>1.6</source>
+          <target>1.6</target>
+          <debug>true</debug>
+          <optimize>false</optimize>
+          <showDeprecation>true</showDeprecation>
+          <showWarnings>true</showWarnings>
+        </configuration>
+      </plugin>
+      <plugin>
+        <artifactId>maven-dependency-plugin</artifactId>
+        <version>2.8</version>
+        <executions>
+          <execution>
+            <id>copy-dependencies</id>
+            <phase>prepare-package</phase>
+            <goals>
+              <goal>copy-dependencies</goal>
+            </goals>
+            <configuration>
+              <outputDirectory>target/deps</outputDirectory>
+              <includeScope>runtime</includeScope>
+            </configuration>
+          </execution>
+          <execution>
+            <id>unpack</id>
+            <phase>package</phase>
+            <goals>
+              <goal>unpack</goal>
+            </goals>
+            <configuration>
+              <artifactItems>
+                <artifactItem>
+                  <groupId>${project.groupId}</groupId>
+                  <artifactId>${project.artifactId}</artifactId>
+                  <version>${project.version}</version>
+                  <type>jar</type>
+                  <includes>META-INF/MANIFEST.MF</includes>
+                  <outputDirectory>target</outputDirectory>
+                </artifactItem>
+              </artifactItems>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+      <plugin>
+        <artifactId>maven-assembly-plugin</artifactId>
+        <executions>
+          <execution>
+            <id>app-package-assembly</id>
+            <phase>package</phase>
+            <goals>
+              <goal>single</goal>
+            </goals>
+            <configuration>
+              <finalName>${project.artifactId}-${project.version}-apexapp</finalName>
+              <appendAssemblyId>false</appendAssemblyId>
+              <descriptors>
+                <descriptor>src/assemble/appPackage.xml</descriptor>
+              </descriptors>
+              <archiverConfig>
+                <defaultDirectoryMode>0755</defaultDirectoryMode>
+              </archiverConfig>
+              <archive>
+                <manifestEntries>
+                  <Class-Path>${apex.apppackage.classpath}</Class-Path>
+                  <DT-Engine-Version>${apex.version}</DT-Engine-Version>
+                  <DT-App-Package-Group-Id>${project.groupId}</DT-App-Package-Group-Id>
+                  <DT-App-Package-Name>${project.artifactId}</DT-App-Package-Name>
+                  <DT-App-Package-Version>${project.version}</DT-App-Package-Version>
+                  <DT-App-Package-Display-Name>${project.name}</DT-App-Package-Display-Name>
+                  <DT-App-Package-Description>${project.description}</DT-App-Package-Description>
+                </manifestEntries>
+              </archive>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+      <plugin>
+        <artifactId>maven-antrun-plugin</artifactId>
+        <version>1.7</version>
+        <executions>
+          <execution>
+            <phase>package</phase>
+            <configuration>
+              <target>
+                <move file="${project.build.directory}/${project.artifactId}-${project.version}-apexapp.jar"
+                    tofile="${project.build.directory}/${project.artifactId}-${project.version}.apa"/>
+              </target>
+            </configuration>
+            <goals>
+              <goal>run</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-install-plugin</artifactId>
+        <version>2.5.2</version>
+        <configuration>
+          <skip>true</skip>
+        </configuration>
+      </plugin>
     </plugins>
   </build>
 
diff --git a/pom.xml b/pom.xml
index 08b2bb4..dbcebad 100644
--- a/pom.xml
+++ b/pom.xml
@@ -228,12 +228,12 @@
         <plugin>
           <groupId>org.apache.maven.plugins</groupId>
           <artifactId>maven-surefire-plugin</artifactId>
-          <version>2.14.1</version>
+          <version>2.19.1</version>
           <dependencies>
             <dependency>
               <groupId>org.apache.maven.surefire</groupId>
               <artifactId>surefire-junit47</artifactId>
-              <version>2.14.1</version>
+              <version>2.19.1</version>
             </dependency>
           </dependencies>
           <configuration>