Ant
From Resin 3.0
Contents |
Ant Tasks Repository
Ant plugin project has been moved to a new home: https://github.com/caucho/ant-plugin
Please use download are at the url above to obtain latest build of ant-plugin.
Up to date documentation for ant plugin resides in the doc directory at https://github.com/caucho/ant-plugin
resin-jspc
Resin 3.1.5 includes a resin-ant.jar in ${resin.home}/plugins/resin-ant.jar with several useful task:
<project name="test" default="test" basedir="."> <property name="resin.home" value="/usr/local/share/resin"/> <target name="test"> <taskdef name="resin-jspc" classname="com.caucho.ant.Jspc"> <classpath> <fileset dir="${resin.home}"> <include name="plugins/resin-ant.jar"/> <include name="lib/*.jar"/> </fileset> </classpath> </taskdef> <resin-jspc rootDirectory="/home/ferg/ws/dist/my-webapp"/> </target> </project>
Deployment tasks
Task and parameter summary
Task name | Parameter name | Required? | Default | Description |
---|---|---|---|---|
Common properties for all tasks | server | Yes | N/A | The IP or address of the Resin server |
port | Yes | N/A | The port of the Resin server's HTTP port | |
user | Yes | N/A | The user to use when logging into the Resin server | |
password | Yes | N/A | The password to use when logging into the Resin server | |
commitMessage | No | N/A | The commit message to log for any changes to the application repository | |
resin-upload-war (com.caucho.ant.ResinUploadWar) | warFile | Yes | N/A | The war file to upload to the Resin server |
stage | No | "default" | The stage to use for the deployed application | |
virtualHost | No | "default" | The virtual host to use for the deployed application | |
contextRoot | No | /[war file prefix] | The context root of the deployed application | |
version | No | N/A | The version to use for the deployed application | |
archive | No | false | When set to true, an archive tag is set in addition to the main tag. Can also be an explicit tag. | |
writeHead | No | true | When set to true and using versioning, a "head" tag is also set. | |
resin-copy-tag (com.caucho.ant.ResinCopyTag) | stage | No | "default" | The stage of the target tag |
virtualHost | No | "default" | The virtual host of the target tag | |
contextRoot | Yes (if tag not given) | N/A | The context root of the target tag | |
version | No | N/A | The version of the target tag | |
sourceStage | No | "default" | The stage of the source tag | |
sourceVirtualHost | No | "default" | The virtual host of the source tag | |
sourceContextRoot | Yes (if sourceTag not given) | N/A | The context root of the source tag | |
sourceVersion | No | N/A | The version of the source tag | |
tag | Yes (if contextRoot not given) | N/A | An explicit target tag | |
sourceTag | Yes (if sourceContextRoot not given) | N/A | An explicit source tag | |
resin-delete-tag (com.caucho.ant.ResinDeleteTag) | stage | No | "default" | The stage of the tag to be deleted |
resin.virtualHost | No | "default" | The virtual host of the tag to be deleted | |
contextRoot | Yes (if tag not given) | N/A | The context root of the tag to be deleted | |
version | No | N/A | The version of the tag to be deleted | |
tag | Yes (if contextRoot not given) | N/A | An explicit tag to be deleted | |
resin-query-tags (com.caucho.ant.ResinQueryTags) | stage | Yes (At least one pattern (either stage, virtualHost, contextRoot, version, or pattern) must be given | "default" | The query pattern for the stage portion of tags in the repository |
virtualHost | Yes (At least one pattern (either stage, virtualHost, contextRoot, version, or pattern) must be given | "default" | The query pattern for the virtual host portion of tags in the repository | |
contextRoot | Yes (At least one pattern (either stage, virtualHost, contextRoot, version, or pattern) must be given | ".*" | The query pattern for the context root portion of tags in the repository | |
version | Yes (At least one pattern (either stage, virtualHost, contextRoot, version, or pattern) must be given | N/A | The query pattern for the version portion of tags in the repository | |
pattern | Yes (At least one pattern (either stage, virtualHost, contextRoot, version, or pattern) must be given | N/A | An explicit query pattern for entire tags in the repository |
resin-upload-war
Resin 4.0.2 will include an Ant deploy client that can deploy applications to a Resin cloud.
<?xml version="1.0"?> <project name="test" default="test" basedir="."> <property name="resin.home" value="/usr/share/resin"/> <target name="test"> <taskdef name="resin-upload-war" classname="com.caucho.ant.ResinUploadWar"> <classpath> <fileset dir="${resin.home}"> <include name="lib/*.jar"/> <include name="plugins/resin-ant.jar"/> </fileset> </classpath> </taskdef> <resin-upload-war server="localhost" port="8080" user="admin" password="myadminpass" warFile="cloudapp.war"/> </target> </project>
To deploy an application with a version, use the "version" attribute:
<resin-upload-war server="localhost" port="8080" user="admin" password="myadminpass" warFile="cloudapp.war" version="1.0"/>
To place an application into another stage before deploying it to production, set the stage attribute:
<resin-upload-war server="localhost" port="8080" user="admin" password="myadminpass" warFile="cloudapp.war" stage="preview"/>
resin-copy-tag
To copy a tag, use the "resin-copy-tag" task:
<?xml version="1.0"?> <project name="test" default="test" basedir="."> <property name="resin.home" value="/usr/share/resin"/> <target name="test"> <taskdef name="resin-copy-tag" classname="com.caucho.ant.ResinCopyTag"> <classpath> <fileset dir="${resin.home}"> <include name="lib/*.jar"/> <include name="plugins/resin-ant.jar"/> </fileset> </classpath> </taskdef> <resin-copy-tag server="localhost" port="8080" user="admin" password="myadminpass" stage="default" contextRoot="cloudapp" sourceStage="preview"/> </target> </project>
Copying tags can be used to move applications between stages, to affect the "head" version of a webapp, or to change the name of a webapp.
resin-delete-tag
To delete a tag, use the "resin-delete-tag" task:
<?xml version="1.0"?> <project name="test" default="test" basedir="."> <property name="resin.home" value="/usr/share/resin"/> <target name="test"> <taskdef name="resin-delete-tag" classname="com.caucho.ant.ResinDeleteTag"> <classpath> <fileset dir="${resin.home}"> <include name="lib/*.jar"/> <include name="plugins/resin-ant.jar"/> </fileset> </classpath> </taskdef> <resin-delete-tag server="localhost" port="8080" user="admin" password="myadminpass" stage="preview" contextRoot="cloudapp"/> </target> </project>
resin-query-tags
<?xml version="1.0"?> <project name="test" default="test" basedir="."> <property name="resin.home" value="/usr/share/resin"/> <target name="test"> <taskdef name="resin-query-tags" classname="com.caucho.ant.ResinQueryTags"> <classpath> <fileset dir="${resin.home}"> <include name="lib/*.jar"/> <include name="plugins/resin-ant.jar"/> </fileset> </classpath> </taskdef> <resin-query-tags server="localhost" port="8080" user="admin" password="myadminpass" contextRoot="cloudapp"/> </target> </project>