<?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>Programmerer.com &#187; arne</title>
	<atom:link href="http://programmerer.com/author/arne/feed/" rel="self" type="application/rss+xml" />
	<link>http://programmerer.com</link>
	<description>Når linker til youtube-videoer med søte katter som snubler og er morsomme i en epost fra en kollega ikke er nok</description>
	<lastBuildDate>Mon, 30 Jan 2012 15:59:17 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.1</generator>
		<item>
		<title>Google AppEngine + IntelliJ, a Step-by-Step Guide</title>
		<link>http://programmerer.com/2009/11/google-appengine-intellij-a-step-by-step-guide/</link>
		<comments>http://programmerer.com/2009/11/google-appengine-intellij-a-step-by-step-guide/#comments</comments>
		<pubDate>Wed, 18 Nov 2009 17:13:56 +0000</pubDate>
		<dc:creator>arne</dc:creator>
				<category><![CDATA[programmering]]></category>
		<category><![CDATA[intellij idea google appengine]]></category>

		<guid isPermaLink="false">http://programmerer.com/?p=103</guid>
		<description><![CDATA[Setting up a new Google AppEngine project in IntelliJ is easy-peasy once you know how. <a href="http://programmerer.com/2009/11/google-appengine-intellij-a-step-by-step-guide/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fprogrammerer.com%2F2009%2F11%2Fgoogle-appengine-intellij-a-step-by-step-guide%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fprogrammerer.com%2F2009%2F11%2Fgoogle-appengine-intellij-a-step-by-step-guide%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>Setting up a new Google AppEngine project in IntelliJ is easy-peasy once you know how. Here&#8217;s how:</p>
<p><strong>Project Setup</strong></p>
<ol>
<li>Create project from scratch
<ul>
<li>type: <strong>Java Module</strong></li>
<li>enable creation of source folder <strong>src</strong></li>
<li>check <strong>Web Application</strong> in the “select technologies” window</li>
</ul>
</li>
<li>Configure project structure
<ul>
<li>Project SDK should be <strong>1.6</strong> (though 1.5 should work too)</li>
<li>Add dependency to library <strong>Google App Engine</strong> (containing appengine-tools-api.jar)</li>
</ul>
</li>
<li>Create config file
<ul>
<li>Create appengine-web.xml in WEB-INF with the following contents:<br />
<em>&lt;?xml version=”1.0” encoding=”utf-8”?&gt;<br />
&lt;appengine-web-app xmlns=”http://appengine.google.com/ns/1.0”&gt;<br />
&lt;application&gt;&lt;/application&gt;<br />
&lt;version&gt;1&lt;/version&gt;<br />
&lt;/appengine-web-app&gt;</em></li>
<li>If you know what application name you should use, go ahead and fill it in.<em><br />
</em></li>
</ul>
</li>
<li>Create servlet
<ul>
<li>Right click project root, choose <strong>New -&gt; Servlet</strong><br />
This will create servlet class and update web.xml as needed.</li>
<li>Add a <strong>servlet mapping</strong> in the Assembly Descriptor tab.<br />
<strong>NOTE</strong>: <em>Make sure the URL Pattern starts with a slash (/).</em></li>
<li>In the servlet’s <strong>doGet</strong> method, add the following:<br />
response.setContentType(“text/plain”);<br />
response.getWriter().println(“Hello, world!”);</li>
</ul>
</li>
<li>Create runner
<ul>
<li>Create <strong>new application</strong> configuration</li>
<li> <strong>Main class</strong>: com.google.appengine.tools.KickStart</li>
<li> <strong>Program parameters</strong>:<br />
com.google.appengine.tools.development.DevAppServerMain out\exploded\[<em>your-project-name</em>]Web</li>
<li> <strong>Environment variables</strong>:<br />
SDK_LIB=C:\lib\appengine-java-sdk\lib<br />
SDK_CONFIG=C:\lib\appengine-java-sdk\config\sdk<br />
(where it is assumed that google app engine SDK is located at C:\lib\appengine-java-sdk)</li>
</ul>
</li>
<li>Open page in browser
<ul>
<li>Navigate to http://localhost:8080/[<em>your-url-pattern</em>]</li>
<li> <strong>NOTE</strong>: To stop/restart the app, use Exit (<img class="alignnone size-full wp-image-104" src="http://programmerer.com/wp-content/uploads/exit.png" alt="exit" width="17" height="16" />) rather than Stop. Otherwise Jetty will keep running in the background.</li>
</ul>
</li>
</ol>
<p><strong>Deploying the application </strong></p>
<ol>
<li>Update the &lt;application&gt; tag in appengine-web.xml so it contains the Google app-id of your project.</li>
<li>Upload to server.
<ul>
<li>If you have set up an external tool (described below), simply invoke the tool from <strong>Tools </strong>&gt;<strong> Google App Engine </strong>&gt;<strong> Deploy</strong></li>
<li>Otherwise, perform the following steps to deploy manually:<strong><br />
</strong></li>
</ul>
<ul>
<li>
<ul>
<li>Open a command line window</li>
<li>Navigate to the app-engine’s bin folder</li>
<li>Enter: appcfg.cmd update [<em>full-path-to-intellij-project-root</em>]\out\exploded\[<em>your-project-name</em>]Web</li>
</ul>
</li>
<li>Enter Google account info when prompted.</li>
<li> <strong>NOTE:</strong> If appcfg.exe reports it cannot find javac.exe, it may be necessary to edit the appcfg.cmd file:<br />
Instead of invoking “java” (which is specifying whichever java happens to be on your system path), use the fully qualified path of the 1.6 JDK’s java.exe.</li>
</ul>
</li>
<li>Open page in browser
<ul>
<li>Navigate to http://[<em>your-app-id</em>].appspot.com/[<em>your-project-name</em>]Web</li>
</ul>
</li>
</ol>
<p><strong>Setting up a new External Tool in IntelliJ</strong></p>
<ol>
<li>Open the <strong>Settings</strong> menu (<em>Ctrl+Alt+S</em>) and click <strong>External Tools</strong> under <strong>IDE Settings</strong>.</li>
<li>Click <strong>Add</strong> and use the following properties:
<ul>
<li> <strong>Name</strong>: Deploy</li>
<li> <strong>Group</strong>: Google App Engine</li>
<li> <strong>Description</strong>: Deploy to Google App Engine</li>
<li> <strong>Menu</strong>: “Main menu” checked</li>
<li> <strong>Open console</strong>: checked</li>
<li> <strong>Synchronize files after execution</strong>: checked</li>
<li> <strong>Program</strong>: C:\lib\appengine-java-sdk\bin\appcfg.cmd</li>
<li> <strong>Parameters</strong>: update $ProjectFileDir$\out\exploded\$ProjectName$Web</li>
<li> <strong>Working directory</strong>: C:\lib\appengine-java-sdk\bin</li>
</ul>
</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://programmerer.com/2009/11/google-appengine-intellij-a-step-by-step-guide/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

