Ant Task Plugin
This guide has been reviewed and reformatted for Ruk-Com Cloud PaaS. Screens may vary slightly by platform version.
Click or tap a screenshot to view it at its original size.
Objective
This guide explains how to use Ant Task Plugin on Ruk-Com Cloud PaaS, with ordered procedures and practical verification points.
Before you begin
- Sign in with an account permitted to manage the relevant environment.
- Confirm the target environment, region and resources before saving changes.
- Create a backup or rollback plan before changing a production system.
Apache AntIt is an open-source Java-based software tool for automating the build process that includes many build-in tasks that allow to compile, test, and run Java applications.
Ant is a flexible authoring tool that doesn't force you to use encryption rules, directory structure, etc. So you can deploy your Java application through the platform using Apache Ant by following these steps:
1. Install the toolApache Antand handlerIvy
2. Add pluginAnt Taskcreatejarfrom the files in the linked repository and add it to Apache Ant's /lib-task folder.
3. Add filesivy.xmlGo to your java project to define tasks used in the build file and manage dependencies. For example:
<ivy-module version="2.0">
<info organisation="com.jelastic" module="jelastic-ant-task"/>
<dependencies>
<dependency org="com.google.code.gson" name="gson" rev="2.8.1"/>
<dependency org="org.apache.httpcomponents" name="httpcore" rev="4.4"/>
<dependency org="org.apache.httpcomponents" name="httpclient" rev="4.4"/>
<dependency org="org.apache.httpcomponents" name="httpmime" rev="4.3.4"/>
<dependency org="commons-codec" name="commons-codec" rev="1.4"/>
<dependency org="commons-logging" name="commons-logging" rev="1.1.1"/>
</dependencies>
</ivy-module>
4. Create a filebuild.xmlfor deployment and provide your credentials in this section. For example:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:ivy="antlib:org.apache.ivy.ant" name="Jelastic Test Task Deploy" basedir="." default="deploy">
<property name="lib.dir" value="lib"/>
<property name="ivy.default.ivy.user.dir" value="${basedir}/lib"/>
<property name="ant.lib.task" value="${basedir}/lib-task/"/>
<path id="lib.path.id">
<fileset dir="${lib.dir}"/>
<fileset dir="${ant.lib.task}"/>
</path>
<target name="deploy" description="Use the Task">
<ivy:retrieve pattern="${lib.dir}/[artifact].[ext]" type="jar" />
<taskdef name="jelastic" classname="com.jelastic.Jelastic" classpathref="lib.path.id"/>
<jelastic email="<!-- account_email -->"
password="<!-- account_password-->"
dir="<!-- target_directory -->"
filename="<!-- deployment_archive -->"
context="<!-- project_context -->"
environment="<!-- environment_name -->"
apihoster="<!-- hoster_domain -->"
>
</jelastic>
</target>
</project>
You can now deploy your Java project with Ant and it will be automatically added to your environment.