<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Deploy Archives - scmGalaxy</title>
	<atom:link href="https://www.scmgalaxy.com/tutorials/tag/deploy/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.scmgalaxy.com/tutorials/tag/deploy/</link>
	<description>A Platform for Software Engineers</description>
	<lastBuildDate>Sat, 27 Feb 2021 09:54:18 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.1</generator>
	<item>
		<title>Clover and Maven working with Distributed Applications</title>
		<link>https://www.scmgalaxy.com/tutorials/clover-and-maven-working-with-distributed-applications/</link>
					<comments>https://www.scmgalaxy.com/tutorials/clover-and-maven-working-with-distributed-applications/#respond</comments>
		
		<dc:creator><![CDATA[scmgalaxy K]]></dc:creator>
		<pubDate>Wed, 07 Jul 2010 09:01:57 +0000</pubDate>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Build]]></category>
		<category><![CDATA[Clover]]></category>
		<category><![CDATA[Clover and Maven working with Distributed Applications]]></category>
		<category><![CDATA[Code Coverage]]></category>
		<category><![CDATA[configure]]></category>
		<category><![CDATA[Deploy]]></category>
		<category><![CDATA[Distributed Applications]]></category>
		<category><![CDATA[Guide]]></category>
		<category><![CDATA[How Clover and Maven works with Distributed Applications]]></category>
		<category><![CDATA[Instructions]]></category>
		<category><![CDATA[Maven]]></category>
		<category><![CDATA[Maven Clover plugin]]></category>
		<category><![CDATA[Process]]></category>
		<category><![CDATA[Run]]></category>
		<guid isPermaLink="false">http://www.scmgalaxy.com/tutorials/2010/07/07/clover-and-maven-working-with-distributed-applications/</guid>

					<description><![CDATA[<p>1.       Configure maven clover plugin. 2.       Build the all components with clover enabled. 3.       Deploy the clover enabled build to [&#8230;]</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/clover-and-maven-working-with-distributed-applications/">Clover and Maven working with Distributed Applications</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><img fetchpriority="high" decoding="async" class="alignnone size-full wp-image-4444" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2010/07/clover-and-maven-working-wi.png" alt="clover-and-maven-working-with-distributed-applications" width="600" height="400" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2010/07/clover-and-maven-working-wi.png 600w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2010/07/clover-and-maven-working-wi-300x200.png 300w" sizes="(max-width: 600px) 100vw, 600px" /></p>
<p class="MsoListParagraphCxSpFirst" style="text-indent: -0.25in; margin: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo1;"><span style="color: #000000;"><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="mso-list: Ignore;"><span style="font-family: Calibri; font-size: small;">1.</span><span style="font: 7pt;">       </span></span></span><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="font-size: small;"><span style="font-family: Calibri;">Configure maven clover plugin.</span></span></span></span></p>
<p class="MsoListParagraphCxSpMiddle" style="text-indent: -0.25in; margin: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo1;"><span style="color: #000000;"><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="mso-list: Ignore;"><span style="font-family: Calibri; font-size: small;">2.</span><span style="font: 7pt;">       </span></span></span><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="font-size: small;"><span style="font-family: Calibri;">Build the all components with clover enabled.</span></span></span></span></p>
<p class="MsoListParagraphCxSpMiddle" style="text-indent: -0.25in; margin: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo1;"><span style="color: #000000;"><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="mso-list: Ignore;"><span style="font-family: Calibri; font-size: small;">3.</span><span style="font: 7pt;">       </span></span></span><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="font-size: small;"><span style="font-family: Calibri;">Deploy the clover enabled build to test server.</span></span></span></span></p>
<p class="MsoListParagraphCxSpMiddle" style="text-indent: -0.25in; margin: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo1;"><span style="color: #000000;"><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="mso-list: Ignore;"><span style="font-family: Calibri; font-size: small;">4.</span><span style="font: 7pt;">       </span></span></span><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="font-size: small;"><span style="font-family: Calibri;">Run the tests.</span></span></span></span></p>
<p class="MsoListParagraphCxSpLast" style="text-indent: -0.25in; margin: 0in 0in 10pt 0.5in; mso-list: l0 level1 lfo1;"><span style="color: #000000;"><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="mso-list: Ignore;"><span style="font-family: Calibri; font-size: small;">5.</span><span style="font: 7pt;">       </span></span></span><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="font-size: small;"><span style="font-family: Calibri;">Create &amp; Review the Code Coverage Report.</span></span></span></span></p>
<p class="MsoNoSpacing" style="margin: 0in 0in 0pt;"><strong style="mso-bidi-font-weight: normal;"><span style="text-decoration: underline;"><span style="color: #000000;"><span style="font-size: small;"><span style="font-family: Calibri;">Configure Maven Clover Plugin</span></span></span></span></strong></p>
<p class="MsoNoSpacing" style="margin: 0in 0in 0pt;"><span style="font-family: Calibri; color: #000000; font-size: small;">Configure the maven plugin in pom.xml .If you are having multi module projects; you can configure the plugin in parent-pom instead of modifying each module’s pom xml.</span></p>
<p class="MsoNoSpacing" style="margin: 0in 0in 0pt;"><strong style="mso-bidi-font-weight: normal;"><span style="text-decoration: underline;"><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="color: #000000;"><span style="font-size: small;"><span style="font-family: Calibri;"><br />
Build all components with clover enabled.</span></span></span></span></span></strong></p>
<p class="MsoNoSpacing" style="margin: 0in 0in 0pt;"><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="color: #000000;"><span style="font-size: small;"><span style="font-family: Calibri;">Run the following command.</span></span></span></span></p>
<p class="MsoNoSpacing" style="margin: 0in 0in 0pt 0.75in;"><strong style="mso-bidi-font-weight: normal;"><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="font-family: Calibri; color: #000000; font-size: small;"> </span></span></strong></p>
<p class="MsoNoSpacing" style="text-indent: 0.25in; margin: 0in 0in 0pt 0.75in;"><span style="font-size: small;"><span style="font-family: Calibri;"><strong style="mso-bidi-font-weight: normal;"><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="color: #000000;"><span style="mso-spacerun: yes;">  </span>“mvn <span class="apple-style-span"><span style="color: black;">-U clover2:setup package clover2:aggregate</span></span></span></span></strong><span class="apple-style-span"><span style="color: black; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;">”</span></span></span></span></p>
<p class="MsoNoSpacing" style="margin: 0in 0in 0pt 0.75in;"><strong style="mso-bidi-font-weight: normal;"><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="font-family: Calibri; color: #000000; font-size: small;"> </span></span></strong></p>
<p class="MsoNoSpacing" style="margin: 0in 0in 0pt;"><strong style="mso-bidi-font-weight: normal;"><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="font-size: small;"><span style="font-family: Calibri;"><span style="color: #000000;"><span style="mso-spacerun: yes;">   </span><span style="mso-tab-count: 1;">             </span>If you got something like this</span></span></span></span></strong></p>
<p class="MsoNoSpacing" style="margin: 0in 0in 0pt 0.75in;"><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="font-size: small;"><span style="font-family: Calibri;"><span style="color: #000000;">[INFO] Loaded from: C:\Documents and Settings\Administrator\.m2\repository\com\cenqua\clover\clover\2.6.3\clover-2.6.3.jar</span></span></span></span></p>
<p class="MsoNoSpacing" style="margin: 0in 0in 0pt 0.75in;"><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="font-size: small;"><span style="font-family: Calibri;"><span style="color: #000000;">[INFO] Clover: Commercial License registered to ABC Corporation.</span></span></span></span></p>
<p class="MsoNoSpacing" style="margin: 0in 0in 0pt 0.75in;"><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="font-size: small;"><span style="font-family: Calibri;"><span style="color: #000000;">[INFO] Creating new database at &#8216;C:\p4_depot\trunk\4A\target\clover\clover.db&#8217;.</span></span></span></span></p>
<p class="MsoNoSpacing" style="margin: 0in 0in 0pt 0.75in;"><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="font-size: small;"><span style="font-family: Calibri;"><span style="color: #000000;">[INFO] Processing files at 1.5 source level.</span></span></span></span></p>
<p class="MsoNoSpacing" style="margin: 0in 0in 0pt 0.75in;"><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="font-size: small;"><span style="font-family: Calibri;"><span style="color: #000000;">[INFO] Clover all over. Instrumented 5 files (1 package).</span></span></span></span></p>
<p class="MsoNoSpacing" style="margin: 0in 0in 0pt 0.75in;"><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="font-size: small;"><span style="font-family: Calibri;"><span style="color: #000000;">[INFO] Elapsed time = 0.532 secs. (9.398 files/sec, 812.03 srclines/sec)</span></span></span></span></p>
<p class="MsoNoSpacing" style="text-indent: 0.5in; margin: 0in 0in 0pt;"><strong style="mso-bidi-font-weight: normal;"><em><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="font-size: small;"><span style="font-family: Calibri;"><span style="color: #000000;">Congratulation, you get clover work with your source!!</span></span></span></span></em></strong></p>
<p class="MsoNoSpacing" style="margin: 0in 0in 0pt;"><strong style="mso-bidi-font-weight: normal;"><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-bidi-font-style: italic;"><span style="font-family: Calibri; color: #000000; font-size: small;"> </span></span></strong></p>
<p class="MsoNoSpacing" style="margin: 0in 0in 0pt;"><strong style="mso-bidi-font-weight: normal;"><span style="text-decoration: underline;"><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-bidi-font-style: italic;"><span style="font-size: small;"><span style="font-family: Calibri;"><span style="color: #000000;">Deploy the clover enabled build to test server.</span></span></span></span></span></strong></p>
<p class="Default" style="margin: 0in 0in 0pt;"><span style="color: #000000;">Deploy the Clover enabled build to the server. The same process as normal </span></p>
<p class="Default" style="margin: 0in 0in 0pt;"><span style="color: #000000;">Copy the Clover registry file to the appropriate directory on each of the test servers </span></p>
<p class="Default" style="margin: 0in 0in 0pt;"><span style="color: #000000;"> </span></p>
<p class="Default" style="margin: 0in 0in 0pt;"><span style="color: #000000;">The registry file is the DB file create during compile, defined by <em>initstring </em>parametersclover‐setup task, this needs to occur after the Clover build is complete, and before you run your tests </span></p>
<p class="Default" style="margin: 0in 0in 0pt;"><span style="color: #000000;"> </span></p>
<p class="Default" style="margin: 0in 0in 0pt;"><span style="color: #000000;">Background: the Clover initstring </span></p>
<p class="Default" style="margin: 0in 0in 0pt;"><span style="color: #000000;"> </span></p>
<p class="Default" style="margin: 0in 0in 0pt;"><span style="color: #000000;">FileName: xxx.db </span></p>
<p class="Default" style="margin: 0in 0in 0pt;"><span style="color: #000000;">At build time, Clover constructs a registry of your source code, and writes it to a file at the location specified in the Clover initstring. When Clover‐ instrumented code is executed (e.g. by running a suite of unit tests), Clover looks in the same location for this registry file to initialise itself. Clover then records coverage data and writes coverage recording files next to the registry file during execution</span></p>
<p class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="font-size: small;"><span style="font-family: Calibri;"><strong><span style="color: black; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;">Notes: gives the folder contains the registry file full control permissions </span></strong></span></span></p>
<p class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"><span style="color: black; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="font-family: Calibri; font-size: small;"> </span></span></p>
<p class="Default" style="margin: 0in 0in 0pt;"><em style="mso-bidi-font-style: normal;"><span style="color: #000000;">Recommended Permissions </span></em></p>
<p class="Default" style="text-align: justify; margin: 0in 0in 0pt;"><span style="color: #000000;">Clover requires access to the Java system properties for runtime configurations, as well as read write access to areas of the file system to read the Clover coverage database and to write coverage information. Clover also uses a shutdown hook to ensure that it flushes any as yet unflushed coverage information to disk when Java exits. To support these requirements, the following security </span></p>
<p class="Default" style="text-align: justify; margin: 0in 0in 0pt;"><span style="color: #000000;">permissions are recommended: </span></p>
<p class="Default" style="text-align: justify; margin: 0in 0in 0pt 1in;"><em style="mso-bidi-font-style: normal;"><span style="color: #000000;"> </span></em></p>
<p class="Default" style="text-align: justify; margin: 0in 0in 0pt 1in;"><em style="mso-bidi-font-style: normal;"><span style="color: #000000;">grant codeBase &#8220;file:/path/to/clover.jar&#8221; { </span></em></p>
<p class="Default" style="text-align: justify; margin: 0in 0in 0pt 1in;"><em style="mso-bidi-font-style: normal;"><span style="color: #000000;">permission java.util.PropertyPermission &#8220;*&#8221;, &#8220;read&#8221;; </span></em></p>
<p class="Default" style="text-align: justify; margin: 0in 0in 0pt 1in;"><em style="mso-bidi-font-style: normal;"><span style="color: #000000;">permission java.io.FilePermission &#8220;&lt;&gt;&#8221;, &#8220;read, write&#8221;; </span></em></p>
<p class="Default" style="text-align: justify; margin: 0in 0in 0pt 1in;"><em style="mso-bidi-font-style: normal;"><span style="color: #000000;">permission java.lang.RuntimePermission &#8220;shutdownHooks&#8221;; </span></em></p>
<p class="Default" style="text-align: justify; margin: 0in 0in 0pt 1in;"><em style="mso-bidi-font-style: normal;"><span style="color: #000000;">} </span></em></p>
<p class="Default" style="margin: 0in 0in 0pt;"><em style="mso-bidi-font-style: normal;"><span style="color: #000000;"> </span></em></p>
<p class="Default" style="margin: 0in 0in 0pt;"><em style="mso-bidi-font-style: normal;"><span style="color: #000000;">Grant Permissions to clover.jar </span></em></p>
<p class="Default" style="text-indent: 0.5in; margin: 0in 0in 0pt;"><span style="color: #000000;">Edit the java.policy file of the java runtime on the test server </span></p>
<p class="Default" style="text-indent: 0.5in; margin: 0in 0in 0pt 0.5in;"><span style="color: #000000;">%JAVA_HOME%/jre/lib/security</span></p>
<p class="Default" style="margin: 0in 0in 0pt;"><span style="color: #000000;"> </span></p>
<p class="Default" style="margin: 0in 0in 0pt 0.5in;"><span style="color: #000000;">Copy clover.jar and license file to the java runtime class path of the test servers </span></p>
<p class="Default" style="text-indent: 0.5in; margin: 0in 0in 0pt;"><span style="color: #000000;">%JAVA_HOME%/jre/lib/ext </span></p>
<p class="Default" style="margin: 0in 0in 0pt;"><span style="color: #000000;"> </span></p>
<p class="Default" style="margin: 0in 0in 0pt;"><span style="color: #000000;"> </span></p>
<p class="Default" style="margin: 0in 0in 0pt;"><strong style="mso-bidi-font-weight: normal;"><span style="text-decoration: underline;"><span style="color: #000000;">Run the test suite</span></span></strong></p>
<p class="Default" style="margin: 0in 0in 0pt;"><span style="color: #000000;">Run the test suite as normal. Either automation test case or manual test case.</span></p>
<p class="Default" style="margin: 0in 0in 0pt;"><span style="color: #000000;"> </span></p>
<p class="Default" style="margin: 0in 0in 0pt;"><strong style="mso-bidi-font-weight: normal;"><span style="text-decoration: underline;"><span style="color: #000000;">Create Code Coverage Report</span></span></strong></p>
<p class="Default" style="margin: 0in 0in 0pt;"><span style="color: #000000;">Copy the coverage recording files to build machine. </span></p>
<p class="Default" style="margin: 0in 0in 0pt;"><span style="color: #000000;"> </span></p>
<p class="Default" style="text-align: justify; margin: 0in 0in 0pt;"><span style="color: #000000;">Once test execution is complete, you will need to copy the coverage recording files from each remote machine to the initstring path on the build machine in order to generate coverage reports. </span></p>
<p class="Default" style="margin: 0in 0in 0pt;"><span style="color: #000000;"> </span></p>
<p class="Default" style="margin: 0in 0in 0pt;"><span style="color: #000000;">Background: CoverageRecording Files </span></p>
<p class="Default" style="margin: 0in 0in 0pt;"><span style="color: #000000;"> </span></p>
<p class="Default" style="text-align: justify; margin: 0in 0in 0pt;"><span style="color: #000000;">Filename:xxx.dbHHHHHHH_TTTTTTTTTT or clover.dbHHHHHHH_TTTTTTTTTT.1 (where HHHHHHH and TTTTTTTTTT are both hex strings) </span></p>
<p class="Default" style="text-align: justify; margin: 0in 0in 0pt;"><span style="color: #000000;">CoverageRecording files contain actual coverage data. When running instrumented code, Clover creates one or more Coverage Recorders. Each Coverage Recorder will write one CoverageRecording file. The number of Coverage Recorders created at runtime depends the nature of the application you are Clovering. In general a new Coverage Recorder will be created for each new ClassLoader instance that loads a Clovered class file. The first hex number in the filename (HHHHHHH) is a unique number based on the recording context. The second hex number (TTTTTTTTTT) is the timestamp (ms since epoch) of the creation of the Clover Recorder. CoverageRecording files are named this way to try to minimise the chance of a name clash. While it is theoretically possible that a name clash could occur, in practice the chances are very small. </span></p>
<p class="Default" style="text-align: justify; margin: 0in 0in 0pt;"><span style="color: #000000;">CoverageRecording files are <strong>written </strong>during the execution of Clover‐instrumented code. CoverageRecording files are <strong>read </strong>during report generation or coverage browsing. </span></p>
<p class="Default" style="margin: 0in 0in 0pt;"><span style="color: #000000;"> </span></p>
<p class="Default" style="margin: 0in 0in 0pt;"><span style="color: #000000;">Run the generating report goal to create the report. </span></p>
<p class="Default" style="margin: 0in 0in 0pt;"><strong style="mso-bidi-font-weight: normal;"><span style="color: #000000;"><span style="mso-tab-count: 2;">                                </span>“mvn clover2:clover”</span></strong></p>
<p class="Default" style="margin: 0in 0in 0pt;"><strong style="mso-bidi-font-weight: normal;"><span style="mso-tab-count: 1;"><span style="color: #000000;">                </span></span></strong></p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/clover-and-maven-working-with-distributed-applications/">Clover and Maven working with Distributed Applications</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.scmgalaxy.com/tutorials/clover-and-maven-working-with-distributed-applications/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How to Run/Deploy Java EE applications on Amazon EC2?</title>
		<link>https://www.scmgalaxy.com/tutorials/running-java-ee-applications-on-amazon-ec2/</link>
					<comments>https://www.scmgalaxy.com/tutorials/running-java-ee-applications-on-amazon-ec2/#comments</comments>
		
		<dc:creator><![CDATA[scmgalaxy K]]></dc:creator>
		<pubDate>Wed, 10 Mar 2010 06:01:03 +0000</pubDate>
				<category><![CDATA[Amazon (Elastic Cloud)]]></category>
		<category><![CDATA[Amazon EC2]]></category>
		<category><![CDATA[Application]]></category>
		<category><![CDATA[AWS]]></category>
		<category><![CDATA[Deploy]]></category>
		<category><![CDATA[Deploy Java EE app on Amazon Ec2]]></category>
		<category><![CDATA[ec2deploy]]></category>
		<category><![CDATA[Guide]]></category>
		<category><![CDATA[How To]]></category>
		<category><![CDATA[How to Deploe Java EE app on Ec2]]></category>
		<category><![CDATA[How to Run Java EE app on Ec2]]></category>
		<category><![CDATA[Instruction]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[Java EE]]></category>
		<category><![CDATA[Java EE app on Ec2]]></category>
		<category><![CDATA[Java EE application on Amazon Ec2]]></category>
		<category><![CDATA[Push]]></category>
		<category><![CDATA[Reference]]></category>
		<category><![CDATA[Run Java EE applications on Amazon EC2]]></category>
		<category><![CDATA[Tutorial]]></category>
		<guid isPermaLink="false">http://www.scmgalaxy.com/tutorials/2010/03/10/running-java-ee-applications-on-amazon-ec2/</guid>

					<description><![CDATA[<p>Running Java EE applications on Amazon EC2: deploying to 20 machines with no money down Computer hardware has traditionally been [&#8230;]</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/running-java-ee-applications-on-amazon-ec2/">How to Run/Deploy Java EE applications on Amazon EC2?</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h1><img decoding="async" class="alignnone size-full wp-image-4109 aligncenter" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2010/03/java-ee-applications-on-ama.png" alt="running-java-ee-applications-on-amazon-ec2" width="600" height="400" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2010/03/java-ee-applications-on-ama.png 600w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2010/03/java-ee-applications-on-ama-300x200.png 300w" sizes="(max-width: 600px) 100vw, 600px" /></h1>
<h1>Running Java EE applications on Amazon EC2: deploying to 20 machines with no money down</h1>
<p>Computer hardware has traditionally been a scarce, expensive resource. In the early days of computing developers had to share a single machine. Today each developer usually has their own machine but it’s rare for a developer to have more than one. This means that running performance tests often involves scavenging for machines.  Likewise, replicating even just part of a production environment is a major undertaking. With <a href="http://www.amazon.com/gp/browse.html?node=201590011" target="_blank" rel="noopener">Amazon’s Elastic Compute Cloud (EC2)</a>, however, things are very different. A set of Linux servers is now just a web service call away. Depending on the <a href="http://www.amazon.com/gp/browse.html?node=370375011" target="_blank" rel="noopener">type of the servers</a> you simply pay 10-80 cents per server per hour for up to 20 servers! No more upfront costs or waiting for machines to be purchased and configured.</p>
<p>To make it easier for enterprise Java developers to use EC2, I have created EC2Deploy.  It’s a Groovy framework for deploying an enterprise Java application on a set of Amazon EC2 servers. EC2Deploy provides a simple, easy to use API for launching a set of EC2 instances; configuring MySQL, Apache and one or more Tomcat servers; and deploying one or more web applications. In addition, it can also run JMeter and collect performance metrics.</p>
<p>Here is an example script that launches some EC2 instances; configures MySQL with one slave, Tomcat and Apache; deploys a single web application on the Tomcat server; and runs a JMeter test with first one thread and then two.</p>
<pre>class ClusterTest extends GroovyTestCase {</pre>
<pre>  void testSomething() {</pre>
<pre>    AWSProperties awsProperties = new</pre>
<pre>        AWSProperties("/…/aws.properties")</pre>
<pre></pre>
<pre>    def ec2 = new EC2(awsProperties)</pre>
<pre></pre>
<pre>    def explodedWar = '…/projecttrack/webapp/target/ptrack'</pre>
<pre></pre>
<pre>    ClusterSpec clusterSpec =</pre>
<pre>       new ClusterSpec()</pre>
<pre>            .schema("ptrack", ["ptrack": "ptrack"],</pre>
<pre>                    ["src/test/resources/testdml1.sql",</pre>
<pre>                     "src/test/resources/testdml2.sql"])</pre>
<pre>            .slaves(1)</pre>
<pre>            .tomcats(1)</pre>
<pre>            .webApp(explodedWar, "ptrack")</pre>
<pre>            .catalinaOptsBuilder({builder, databasePrivateDnsName -&gt;</pre>
<pre>                 builder.arg("-Xmx500m")</pre>
<pre>                 builder.prop("com.sun.management.jmxremote")</pre>
<pre>                 builder.prop("com.sun.management.jmxremote.port", 8091)</pre>
<pre>                 builder.prop("com.sun.management.jmxremote.authenticate",</pre>
<pre>                                     false)</pre>
<pre>                 builder.prop("com.sun.management.jmxremote.ssl", false)</pre>
<pre>                 builder.prop("ptrack.application.environment", "ec2")</pre>
<pre>                 builder.prop("log4j.configuration",</pre>
<pre>                               "log4j-minimal.properties")</pre>
<pre>                 builder.prop("jdbc.db.server", databasePrivateDnsName)})</pre>
<pre></pre>
<pre>    SimpleCluster cluster = new SimpleCluster(ec2, clusterSpec)</pre>
<pre></pre>
<pre>    cluster.loadTest("…/projecttrack/functionalTests/jmeter/SimpleTest.jmx",</pre>
<pre>        [1, 2])</pre>
<pre></pre>
<pre>    cluster.stop()</pre>
<pre>  }</pre>
<pre>}</pre>
<p>Let’s look at each of the pieces.</p>
<p>First, we need to configure the framework as follows:</p>
<pre>    AWSProperties awsProperties = new</pre>
<pre>        AWSProperties("/…/aws.properties")</pre>
<pre>    def ec2 = new EC2(awsProperties)</pre>
<p>The aws.properties file contains various properties including the Amazon WS security credentials and the EC2 AMI (i.e. OS image) to launch. All servers use my EC2 appliance AMI that has Java, MySQL, Apache, Tomcat, Jmeter and some other useful tools pre-installed.</p>
<p>Next we need to configure the servers:</p>
<pre>     ClusterSpec clusterSpec =</pre>
<pre>        new ClusterSpec()</pre>
<pre>             .schema("ptrack", ["ptrack": "ptrack"],</pre>
<pre>                    ["src/test/resources/testdml1.sql",</pre>
<pre>                     "src/test/resources/testdml2.sql"])</pre>
<pre>             .slaves(1)</pre>
<pre>             .tomcats(1)</pre>
<pre>             .webApp(explodedWar, "ptrack")</pre>
<pre>             .catalinaOptsBuilder({builder, databasePrivateDnsName -&gt;</pre>
<pre>                 builder.arg("-Xmx500m")</pre>
<pre>                 builder.prop("com.sun.management.jmxremote")</pre>
<pre>                 builder.prop("com.sun.management.jmxremote.port", 8091)</pre>
<pre>                 builder.prop("com.sun.management.jmxremote.authenticate",</pre>
<pre>                                     false)</pre>
<pre>                 builder.prop("com.sun.management.jmxremote.ssl", false)</pre>
<pre>                 builder.prop("ptrack.application.environment", "ec2")</pre>
<pre>                 builder.prop("log4j.configuration",</pre>
<pre>                               "log4j-minimal.properties")</pre>
<pre>                 builder.prop("jdbc.db.server", databasePrivateDnsName)})</pre>
<pre></pre>
<pre>     SimpleCluster cluster = new SimpleCluster(ec2, clusterSpec)</pre>
<p>This code first creates a ClusterSpec, which defines the configuration of the machines and the applications:</p>
<ul>
<li>schema() – specifies the name of the database schema to create; names of the users and their passwords; the DML scripts to execute once the database has been create</li>
<li>slaves() – specifies how many MySql slaves to create</li>
<li>tomcats() &#8211; specifies how many Tomcats to run.</li>
<li>webApp() &#8211; configures a web application. This method takes two parameters: the path to the exploded WAR directory (conveniently created by Maven) and the context to deploy the web application under.</li>
<li>catalinaOptsBuilder() – supplies a closure that takes a builder and the DNS name of the MySQL server as arguments and returns the CATALINA_OPTS used to launch Tomcat. It’s primary purpose is to configure the web application(s) to use the correct database server</li>
</ul>
<p>It then creates a cluster with that specification.</p>
<p>We then start the cluster:</p>
<pre>    cluster.start()</pre>
<p>At this point EC2Deploy will:</p>
<ol>
<li>Launch the EC2 instances running my appliance AMI.</li>
<li>Initialize the MySql master database</li>
<li>Create the MySql slave</li>
<li>Create the database schema and the users</li>
<li>Run any DML scripts (these are cached on S3 in a bucket called “tmp&#8211;dml” for the reasons described next)</li>
<li>Upload the web applications to <a href="http://www.amazon.com/gp/browse.html?node=16427261" target="_blank" rel="noopener">Amazon S3 (Simple Storage Service)</a> where they are cached in order to avoid time consuming uploads (over slow DSL connections, for example). EC2Deploy only uploads new and changed files, which means that the bulky 3<sup>rd</sup> party libraries are only uploaded once. Each web application is stored in an S3 bucket called -tmp-war. If this bucket does not exist you will see some warning messages and the bucket will be created.</li>
<li>Deploy the web applications on each of the Tomcat servers</li>
<li>Configure Apache to load balance across the Tomcat servers</li>
</ol>
<p>Once the cluster is started we can run a JMeter load test:</p>
<pre>    cluster.loadTest("…/projecttrack/functionalTests/jmeter/SimpleTest.jmx", [1, 2])</pre>
<p>The first argument specifies the test to run and the second argument is a list of JMeter thread counts. In this example, EC2deploy first runs the load test with one thread and then two threads. For each test run, it generates a report describing CPU utilization for each machine, average response time and throughput.</p>
<p>Finally, we stop the EC2 instances:</p>
<p>cluster.stop()</p>
<p>As you can see, EC2Deploy makes it pretty easy to deploy and test your enterprise Java application. I’ve used it to clone a production environment and run load tests. NOTE 1/28/08: The source code EC2Deploy along with a very cool Maven plugin is now <a href="http://www.chris-richardson.blog-city.com/ec2deploy_and_the_cloud_tools_maven_plugin_are_now_available.htm">available</a> !</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/running-java-ee-applications-on-amazon-ec2/">How to Run/Deploy Java EE applications on Amazon EC2?</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.scmgalaxy.com/tutorials/running-java-ee-applications-on-amazon-ec2/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>EC2Deploy and the Cloud Tools Maven plugin are now available</title>
		<link>https://www.scmgalaxy.com/tutorials/ec2deploy-and-the-cloud-tools-maven-plugin-are-now-available/</link>
					<comments>https://www.scmgalaxy.com/tutorials/ec2deploy-and-the-cloud-tools-maven-plugin-are-now-available/#comments</comments>
		
		<dc:creator><![CDATA[scmgalaxy K]]></dc:creator>
		<pubDate>Wed, 10 Mar 2010 05:59:56 +0000</pubDate>
				<category><![CDATA[Amazon (Elastic Cloud)]]></category>
		<category><![CDATA[Maven]]></category>
		<category><![CDATA[Cloud]]></category>
		<category><![CDATA[Cloud Tools]]></category>
		<category><![CDATA[Cloud Tools Maven Plugin]]></category>
		<category><![CDATA[Deploy]]></category>
		<category><![CDATA[Deploy to Amazon EC2]]></category>
		<category><![CDATA[Deploy web application project to EC2]]></category>
		<category><![CDATA[ec2]]></category>
		<category><![CDATA[ec2deploy]]></category>
		<category><![CDATA[EC2Deploy framework]]></category>
		<category><![CDATA[Maven plugin]]></category>
		<category><![CDATA[Plugin]]></category>
		<category><![CDATA[Web application]]></category>
		<guid isPermaLink="false">http://www.scmgalaxy.com/tutorials/2010/03/10/ec2deploy-and-the-cloud-tools-maven-plugin-are-now-available/</guid>

					<description><![CDATA[<p>I&#8217;m pleased to announce that EC2Deploy &#8211; a Groovy-based framework for deploying Java EE applications to Amazon EC2 &#8211; is [&#8230;]</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/ec2deploy-and-the-cloud-tools-maven-plugin-are-now-available/">EC2Deploy and the Cloud Tools Maven plugin are now available</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><img decoding="async" class="alignnone size-full wp-image-4112 aligncenter" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2010/03/ec2deploy-and-the-cloud-too.png" alt="ec2deploy-cloud-tools-maven-plugin" width="600" height="400" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2010/03/ec2deploy-and-the-cloud-too.png 600w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2010/03/ec2deploy-and-the-cloud-too-300x200.png 300w" sizes="(max-width: 600px) 100vw, 600px" /></p>
<p>I&#8217;m pleased to announce that <a href="http://www.chris-richardson.blog-city.com/running_jee_applications_on_amazon_ec2_or_deploying_to_20_m.htm">EC2Deploy</a> &#8211; a Groovy-based framework for deploying Java EE applications to Amazon EC2 &#8211; is now available as part of the <a href="http://code.google.com/p/cloudtools/">Cloud Tools</a> open source project.</p>
<p>There are three main parts to Cloud Tools:</p>
<ul>
<li>The EC2Deploy framework</li>
<li>Amazon Machine Images (AMIs) that are configured to run Tomcat and work with EC2Deploy</li>
<li>A Maven plugin that uses EC2Deploy to deploy a web application to EC2</li>
</ul>
<p>I’m especially excited about the Maven plugin. Once you have configured the plugin for your web application you can use the following goals:</p>
<ul>
<li>cloudtools:deploy – launch the EC2 instances and deploy the web application</li>
<li>cloudtools:redeploy – redeploy the web application (upload the changes and restart tomcat)</li>
<li>cloudtools:jmeter – run a Jmeter test</li>
<li>cloudtools:stop – stop the EC2 instances</li>
</ul>
<p>Cloudtools is still work in progress but it let’s you deploy a web application on EC2 in just a few minutes.  To learn more go to <a href="http://code.google.com/p/cloudtools/">Cloud Tools</a>.</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/ec2deploy-and-the-cloud-tools-maven-plugin-are-now-available/">EC2Deploy and the Cloud Tools Maven plugin are now available</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.scmgalaxy.com/tutorials/ec2deploy-and-the-cloud-tools-maven-plugin-are-now-available/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
	</channel>
</rss>
