Force.com Migration Tool Enhancements

The Force.com Migration Tool has been enhanced to support deploying recent validations, canceling a deployment, and authenticating with a session ID.
Deploy a Recent Validation
To deploy a recent validation, add the <sf:deployRecentValidation> task to your target and specify the validation ID in the recentValidationId parameter. The validation must have run successfully within the last four days. For more information, see Quick Deployments in the Salesforce Help.
<target name="quickDeploy">
  <sf:deployRecentValidation username="${sf.username}" password="${sf.password}" 
                             sessionId="${sf.sessionId}" serverurl="${sf.serverurl}"
                             maxPoll="${sf.maxPoll}"
                             recentValidationId="${sf.​recentValidationId}"/>
</target>
Support for <sf:deployRecentValidation> starts with version 34.0 of the Force.com Migration Tool.
Cancel a Deployment
You can now cancel a deployment that’s in progress or queued with the Force.com Migration Tool. To do so, add the <sf:cancelDeploy> task to your target. Specify the ID of the deployment in the requestId parameter.
<target name="cancelDeploy">
  <sf:cancelDeploy username="${sf.username}" password="${sf.password}" 
                   sessionId="${sf.sessionId}" serverurl="${sf.serverurl}" maxPoll="${sf.maxPoll} 
                   requestId="${sf.​deployRequestId}"/>
</target>
Support for sf:cancelDeploy starts with version 34.0 of the Force.com Migration Tool.
Use a Session ID for Authentication
When you run the Force.com Migration Tool to perform a migration, you can authenticate with a session ID instead of a username and password. Using session ID authentication provides more flexibility. The Force.com Migration Tool build.properties file has been updated to include the sf.sessionId property. Similarly, the sample targets in the build.xml file have been updated to include the sessionId parameter.
To use the session ID for authentication, uncomment this property in build.properties and add a value for the session ID. In addition, comment out the sf.username and sf.password property pair. Both properties can’t be present at the same time. The following is the session ID property in build.properties.
sf.sessionId = <Insert your Salesforce session ID here.>
This sample target contains the <sf:deploy> task with the sessionId parameter.
<target name="deployZip">
  <sf:deploy username="${sf.username}" password="${sf.password}" 
             sessionId="${sf.sessionId}" 
             serverurl="${sf.serverurl}" maxPoll="${sf.maxPoll}" 
             zipFile="${sf.zipFile}" pollWaitMillis="1000" 
             rollbackOnError="true"/>
</target>
Support for session ID authentication is available in all new versions of the Force.com Migration Tool and in older versions since version 17.0.