{"id":72,"date":"2009-01-27T07:37:41","date_gmt":"2009-01-27T14:37:41","guid":{"rendered":"http:\/\/www.connorgarvey.com\/blog\/?p=72"},"modified":"2010-02-12T09:24:41","modified_gmt":"2010-02-12T16:24:41","slug":"terracotta-startup-using-ant-tutorial","status":"publish","type":"post","link":"https:\/\/connorgarvey.com\/blog\/?p=72","title":{"rendered":"Terracotta setup using Ant tutorial"},"content":{"rendered":"<p>I just started using Terracotta for the first time.\u00a0 This is how I put it in my project and configured Ant tasks to start and stop the server.  The client is using Windows, so the Ant tasks work in Windows.<\/p>\n<ol>\n<li>Create tc-config.xml in the root of the project.\n<div id=\"wpshdo_1\" class=\"wp-synhighlighter-outer\"><div id=\"wpshdt_1\" class=\"wp-synhighlighter-expanded\"><table border=\"0\" width=\"100%\"><tr><td align=\"left\" width=\"80%\"><a name=\"#codesyntax_1\"><\/a><a id=\"wpshat_1\" class=\"wp-synhighlighter-title\" href=\"#codesyntax_1\"  onClick=\"javascript:wpsh_toggleBlock(1)\" title=\"Click to show\/hide code block\">Code block<\/a><\/td><td align=\"right\"><a href=\"#codesyntax_1\" onClick=\"javascript:wpsh_code(1)\" title=\"Show code only\"><img decoding=\"async\" border=\"0\" style=\"border: 0 none\" src=\"https:\/\/connorgarvey.com\/blog\/wp-content\/plugins\/wp-synhighlight\/themes\/default\/images\/code.png\" \/><\/a>&nbsp;<a href=\"#codesyntax_1\" onClick=\"javascript:wpsh_print(1)\" title=\"Print code\"><img decoding=\"async\" border=\"0\" style=\"border: 0 none\" src=\"https:\/\/connorgarvey.com\/blog\/wp-content\/plugins\/wp-synhighlight\/themes\/default\/images\/printer.png\" \/><\/a>&nbsp;<a href=\"https:\/\/connorgarvey.com\/blog\/wp-content\/plugins\/wp-synhighlight\/About.html\" target=\"_blank\" title=\"Show plugin information\"><img decoding=\"async\" border=\"0\" style=\"border: 0 none\" src=\"https:\/\/connorgarvey.com\/blog\/wp-content\/plugins\/wp-synhighlight\/themes\/default\/images\/info.gif\" \/><\/a>&nbsp;<\/td><\/tr><\/table><\/div><div id=\"wpshdi_1\" class=\"wp-synhighlighter-inner\" style=\"display: block;\"><pre class=\"xml\" style=\"font-family:monospace;\"><span class=\"sc3\"><span class=\"re1\">&lt;?xml<\/span> <span class=\"re0\">version<\/span>=<span class=\"st0\">&quot;1.0&quot;<\/span> <span class=\"re0\">encoding<\/span>=<span class=\"st0\">&quot;UTF-8&quot;<\/span><span class=\"re2\">?&gt;<\/span><\/span>\n<span class=\"sc3\"><span class=\"re1\">&lt;con:tc-config<\/span> <span class=\"re0\">xmlns:con<\/span>=<span class=\"st0\">&quot;http:\/\/www.terracotta.org\/config&quot;<\/span><span class=\"re2\">&gt;<\/span><\/span>\n  <span class=\"sc3\"><span class=\"re1\">&lt;servers<span class=\"re2\">&gt;<\/span><\/span><\/span>\n    <span class=\"sc3\"><span class=\"re1\">&lt;server<\/span> <span class=\"re0\">host<\/span>=<span class=\"st0\">&quot;%i&quot;<\/span> <span class=\"re0\">name<\/span>=<span class=\"st0\">&quot;localhost&quot;<\/span><span class=\"re2\">&gt;<\/span><\/span>\n      <span class=\"sc3\"><span class=\"re1\">&lt;dso-port<span class=\"re2\">&gt;<\/span><\/span><\/span>9510<span class=\"sc3\"><span class=\"re1\">&lt;\/dso-port<span class=\"re2\">&gt;<\/span><\/span><\/span>\n      <span class=\"sc3\"><span class=\"re1\">&lt;jmx-port<span class=\"re2\">&gt;<\/span><\/span><\/span>9520<span class=\"sc3\"><span class=\"re1\">&lt;\/jmx-port<span class=\"re2\">&gt;<\/span><\/span><\/span>\n      <span class=\"sc3\"><span class=\"re1\">&lt;data<span class=\"re2\">&gt;<\/span><\/span><\/span>bin\/terracotta\/server-data<span class=\"sc3\"><span class=\"re1\">&lt;\/data<span class=\"re2\">&gt;<\/span><\/span><\/span>\n      <span class=\"sc3\"><span class=\"re1\">&lt;logs<span class=\"re2\">&gt;<\/span><\/span><\/span>bin\/terracotta\/server-logs<span class=\"sc3\"><span class=\"re1\">&lt;\/logs<span class=\"re2\">&gt;<\/span><\/span><\/span>\n      <span class=\"sc3\"><span class=\"re1\">&lt;statistics<span class=\"re2\">&gt;<\/span><\/span><\/span>bin\/terracotta\/cluster-statistics<span class=\"sc3\"><span class=\"re1\">&lt;\/statistics<span class=\"re2\">&gt;<\/span><\/span><\/span>\n    <span class=\"sc3\"><span class=\"re1\">&lt;\/server<span class=\"re2\">&gt;<\/span><\/span><\/span>\n    <span class=\"sc3\"><span class=\"re1\">&lt;update-check<span class=\"re2\">&gt;<\/span><\/span><\/span>\n      <span class=\"sc3\"><span class=\"re1\">&lt;enabled<span class=\"re2\">&gt;<\/span><\/span><\/span>true<span class=\"sc3\"><span class=\"re1\">&lt;\/enabled<span class=\"re2\">&gt;<\/span><\/span><\/span>\n    <span class=\"sc3\"><span class=\"re1\">&lt;\/update-check<span class=\"re2\">&gt;<\/span><\/span><\/span>\n  <span class=\"sc3\"><span class=\"re1\">&lt;\/servers<span class=\"re2\">&gt;<\/span><\/span><\/span>\n  <span class=\"sc3\"><span class=\"re1\">&lt;clients<span class=\"re2\">&gt;<\/span><\/span><\/span>\n    <span class=\"sc3\"><span class=\"re1\">&lt;logs<span class=\"re2\">&gt;<\/span><\/span><\/span>bin\/terracotta\/client-logs<span class=\"sc3\"><span class=\"re1\">&lt;\/logs<span class=\"re2\">&gt;<\/span><\/span><\/span>\n    <span class=\"sc3\"><span class=\"re1\">&lt;statistics<span class=\"re2\">&gt;<\/span><\/span><\/span>bin\/terracotta\/client-statistics\/%D<span class=\"sc3\"><span class=\"re1\">&lt;\/statistics<span class=\"re2\">&gt;<\/span><\/span><\/span>\n    <span class=\"sc3\"><span class=\"re1\">&lt;modules<span class=\"re2\">&gt;<\/span><\/span><\/span>\n      <span class=\"sc3\"><span class=\"re1\">&lt;module<\/span> <span class=\"re0\">name<\/span>=<span class=\"st0\">&quot;tim-hibernate-3.2.5&quot;<\/span> <span class=\"re0\">version<\/span>=<span class=\"st0\">&quot;1.2.2&quot;<\/span><span class=\"re2\">\/&gt;<\/span><\/span>\n      <span class=\"sc3\"><span class=\"re1\">&lt;module<\/span> <span class=\"re0\">name<\/span>=<span class=\"st0\">&quot;tim-ehcache-1.3&quot;<\/span> <span class=\"re0\">version<\/span>=<span class=\"st0\">&quot;1.2.2&quot;<\/span><span class=\"re2\">\/&gt;<\/span><\/span>\n      <span class=\"sc3\"><span class=\"re1\">&lt;module<\/span> <span class=\"re0\">name<\/span>=<span class=\"st0\">&quot;tim-cglib-2.1.3&quot;<\/span> <span class=\"re0\">version<\/span>=<span class=\"st0\">&quot;1.2.2&quot;<\/span><span class=\"re2\">\/&gt;<\/span><\/span>\n      <span class=\"sc3\"><span class=\"re1\">&lt;module<\/span> <span class=\"re0\">name<\/span>=<span class=\"st0\">&quot;tim-ehcache-commons&quot;<\/span> <span class=\"re0\">version<\/span>=<span class=\"st0\">&quot;1.2.2&quot;<\/span><span class=\"re2\">\/&gt;<\/span><\/span>\n    <span class=\"sc3\"><span class=\"re1\">&lt;\/modules<span class=\"re2\">&gt;<\/span><\/span><\/span>\n  <span class=\"sc3\"><span class=\"re1\">&lt;\/clients<span class=\"re2\">&gt;<\/span><\/span><\/span>\n<span class=\"sc3\"><span class=\"re1\">&lt;\/con:tc-config<span class=\"re2\">&gt;<\/span><\/span><\/span><\/pre><\/div><\/div>\n<\/li>\n<li>Put Terracotta into your library directory.\u00a0 You&#8217;ll need bin, docs, lib and schema directories and the license files.\n<ol>\n<li>You don&#8217;t need the licenses for the software to work, but it&#8217;s always a good idea to include them, especially if your app is <em>not<\/em> open source \ud83d\ude1b<\/li>\n<\/ol>\n<\/li>\n<li>Create the Ant targets.\n<pre>&lt;target name=\"start.terracotta.windows\"&gt;\r\n  &lt;exec executable=\"cmd\"&gt;\r\n    &lt;arg value=\"\/c\"\/&gt;\r\n    &lt;arg value=\"lib\\terracotta-2.7.2\\bin\\start-tc-server.bat\"\/&gt;\r\n  &lt;\/exec&gt;\r\n&lt;\/target&gt;\r\n\r\n&lt;target name=\"stop.terracotta.windows\"&gt;\r\n  &lt;exec executable=\"cmd\"&gt;\r\n    &lt;arg value=\"\/c\"\/&gt;\r\n    &lt;arg value=\"lib\\terracotta-2.7.2\\bin\\stop-tc-server.bat\"\/&gt;\r\n  &lt;\/exec&gt;\r\n&lt;\/target&gt;<\/pre>\n<ol>\n<li>Notice the backslashes there.\u00a0 Normally, Ant will convert forward slashes to backslashes in Windows.\u00a0 Since this is a command line argument, though, it doesn&#8217;t.\u00a0 If you&#8217;re running on both *nix and Windows, you&#8217;ll have to have two versions of the paths, one with forward and one with back slashes.<\/li>\n<\/ol>\n<\/li>\n<li>That&#8217;s it.  Run the start task to start and the stop task to stop.<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>I just started using Terracotta for the first time.\u00a0 This is how I put it in my project and configured Ant tasks to start and stop the server. The client is using Windows, so the Ant tasks work in Windows. Create tc-config.xml in the root of the project. Put Terracotta into your library directory.\u00a0 You&#8217;ll [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false},"version":2}},"categories":[18],"tags":[19,20,4,7,58],"class_list":["post-72","post","type-post","status-publish","format-standard","hentry","category-terracotta","tag-ant","tag-cache","tag-java","tag-redpoint","tag-terracotta"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p1ql2n-1a","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/connorgarvey.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/72","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/connorgarvey.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/connorgarvey.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/connorgarvey.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/connorgarvey.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=72"}],"version-history":[{"count":9,"href":"https:\/\/connorgarvey.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/72\/revisions"}],"predecessor-version":[{"id":78,"href":"https:\/\/connorgarvey.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/72\/revisions\/78"}],"wp:attachment":[{"href":"https:\/\/connorgarvey.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=72"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/connorgarvey.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=72"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/connorgarvey.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=72"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}