<?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>Grails Geek &#187; development</title>
	<atom:link href="http://grailsgeek.com/category/development/feed/" rel="self" type="application/rss+xml" />
	<link>http://grailsgeek.com</link>
	<description>Grails tips I wanna share with you ;)</description>
	<lastBuildDate>Sun, 01 Nov 2009 13:29:51 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Adding WebFlow support to Maven driven Grails project</title>
		<link>http://grailsgeek.com/2009/07/adding-webflow-support-to-maven-driven-grails-project/</link>
		<comments>http://grailsgeek.com/2009/07/adding-webflow-support-to-maven-driven-grails-project/#comments</comments>
		<pubDate>Sun, 26 Jul 2009 16:56:07 +0000</pubDate>
		<dc:creator>Alexander Naumenko</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[grails]]></category>
		<category><![CDATA[maven]]></category>
		<category><![CDATA[webflow]]></category>

		<guid isPermaLink="false">http://grailsgeek.com/?p=58</guid>
		<description><![CDATA[It&#8217;s just simple tip, but you could find it useful if you noob in Maven. WebFlow comes with Grails by default, but since we develop with Maven we should include this dependency manually. Just modify your Grails project pom.xml dependencies by including webflow reference:
&#60;?xml version="1.0" encoding="UTF-8"?&#62;
&#60;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"&#62;
    ...
  [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s just simple tip, but you could find it useful if you noob in Maven. <span style="color: #333399;">WebFlow</span> comes with Grails by default, but since we develop with Maven we should include this dependency manually. Just modify your Grails project <span style="color: #333399;">pom.xml</span> dependencies by including webflow reference:</p>
<pre class="brush:xml">&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"&gt;
    ...
    &lt;dependencies&gt;
        ...
        &lt;dependency&gt;
            &lt;groupId&gt;org.grails&lt;/groupId&gt;
            &lt;artifactId&gt;grails-webflow&lt;/artifactId&gt;
            &lt;version&gt;1.1.1&lt;/version&gt;
        &lt;/dependency&gt;
        ...
    &lt;/dependencies&gt;
    ...
&lt;/project&gt;</pre>
]]></content:encoded>
			<wfw:commentRss>http://grailsgeek.com/2009/07/adding-webflow-support-to-maven-driven-grails-project/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS convention for Grails</title>
		<link>http://grailsgeek.com/2009/07/css-convention-for-grails/</link>
		<comments>http://grailsgeek.com/2009/07/css-convention-for-grails/#comments</comments>
		<pubDate>Sun, 26 Jul 2009 15:58:16 +0000</pubDate>
		<dc:creator>Alexander Naumenko</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[CSS convention]]></category>
		<category><![CDATA[grails]]></category>

		<guid isPermaLink="false">http://grailsgeek.com/?p=43</guid>
		<description><![CDATA[As far as our CSS styles grow I found that there should intuitive way to manage CSS inclusions. I&#8217;ve decided to follow great Grails fundamental idea and place them by some convention and include automagically.
We found useful to have separate CSS for each view (or controller action if you wish). Convention is simple: place each [...]]]></description>
			<content:encoded><![CDATA[<p>As far as our CSS styles grow I found that there should intuitive way to manage CSS inclusions. I&#8217;ve decided to follow great Grails fundamental idea and place them by some convention and include automagically.</p>
<p>We found useful to have separate CSS for each view (or controller action if you wish). Convention is simple: place each CSS in the same path as you place your views under <span style="color: #333399;">/views</span> folder.</p>
<p>For example, we have view: <span style="color: #333399;">/views/picture/gallery.gsp</span> and want to have <span style="color: #333399;">gallery.css</span> which contains all styles for this view. We should place it in the same path as our view located, in our example it should be <span style="color: #333399;">/web-app/css/picture/gallery.css</span>. Now to automatically include such CSSs by convention we should modify our main layout (<span style="color: #333399;">/views/layouts/main.gsp</span>) next way:</p>
<pre class="brush:groovy">&lt;head&gt;
...
&lt;% if (webRequest.controllerName &amp;&amp; webRequest.actionName) { %&gt;
    &lt;link rel="stylesheet" href="${resource(dir: 'css/' + webRequest.getControllerName(), file: webRequest.getActionName() + '.css')}"/&gt;
&lt;% } %&gt;
...
&lt;/head&gt;</pre>
<p>All further CSSs placed by this convention will be automatically included for each action (which uses <span style="color: #333399;">main</span> layout) . If you have more layouts you could modify them same way. Anyway their count will be much less than your actions/views count.</p>
<p>Hope this helps. If you have some ideas to improve this approach or you use some other approach, please share :)</p>
<pre></pre>
]]></content:encoded>
			<wfw:commentRss>http://grailsgeek.com/2009/07/css-convention-for-grails/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Settin&#8217; up Grails 1.1.1. with Grails Maven Plugin in Intellij IDEA + JetGroovy</title>
		<link>http://grailsgeek.com/2009/06/grails-and-maven2-in-intellij-idea/</link>
		<comments>http://grailsgeek.com/2009/06/grails-and-maven2-in-intellij-idea/#comments</comments>
		<pubDate>Mon, 08 Jun 2009 10:02:00 +0000</pubDate>
		<dc:creator>Alexander Naumenko</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[grails]]></category>
		<category><![CDATA[grails-maven-plugin]]></category>
		<category><![CDATA[intellij idea]]></category>
		<category><![CDATA[jetgroovy]]></category>
		<category><![CDATA[maven]]></category>
		<category><![CDATA[setup]]></category>

		<guid isPermaLink="false">http://grailsgeek.com/2009/06/grails-1-1-1-and-maven2-in-intellij-idea/</guid>
		<description><![CDATA[Grails Maven Plugin is still non predictable and it&#8217;s 1.0 version supports only 1.1 version of Grails. 1.1-SNAPSHOT version supports grails 1.1.1 but there are still misunderstandings with Grails plugins are exist (Grails wants to store them in your user home, but  Grails Maven plugin wants them to be stored in your application dir).
As for [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">Grails Maven Plugin is still non predictable and it&#8217;s <span style="color: #333399;">1.0</span> version supports only <span style="color: #333399;">1.1</span> version of Grails.<span style="color: #333399;"> 1.1-SNAPSHOT</span> version supports grails <span style="color: #333399;">1.1.1</span> but there are still misunderstandings with Grails plugins are exist (Grails wants to store them in your user home, but  Grails Maven plugin wants them to be stored in your application dir).</p>
<p style="text-align: justify;">As for now I&#8217;m trying to avoid using plugins from Grails, and include all libraries directly with Maven dependencies.</p>
<p style="text-align: justify;">1. Make your maven know where to get <span style="color: #333399;">grails-maven-plugin</span> by editing your<span style="color: #333399;"> /.m2/settings.xml </span>(create it if there is no one exist):</p>
<pre class="brush:xml">&lt;settings&gt;
    &lt;pluginGroups&gt;
        &lt;pluginGroup&gt;org.grails&lt;/pluginGroup&gt;
    &lt;/pluginGroups&gt;
&lt;/settings&gt;</pre>
<p>2. Go to secret place where you store you projects and run:</p>
<pre class="brush:bash">mvn org.apache.maven.plugins:maven-archetype-plugin:2.0-alpha-4:generate -DarchetypeGroupId=org.grails -DarchetypeArtifactId=grails-maven-archetype -DarchetypeVersion=1.0 -DgroupId=example -DartifactId=maven-grails-demo</pre>
<p>3. Now open just generated pom.xml and make following changes:</p>
<ul>
<li>
<div class="western">change versions of <em>grails-crud </em>and  <em>grails-gorm </em><span style="font-style: normal;">from <span style="color: #333399;">“1.1”</span> to<span style="color: #333399;"> “1.1.1”</span></span></div>
</li>
<li>
<div class="western"><span style="font-style: normal;">change </span><em>grails-maven-plugin </em><span style="font-style: normal;">version  from <span style="color: #333399;">“1.0”</span> to <span style="color: #333399;">“1.1-SNAPSHOT”</span></span></div>
</li>
</ul>
<div class="western"><span style="font-style: normal;"> 4. Run <span style="color: #333399;">“mvn initialize”</span> from your project root.</span></div>
<div class="western" style="text-align: justify;"><span style="font-style: normal;"> 5. One more trick, that should be applied for 1.1-SNAPSHOT version of  <span style="font-style: italic;">grails-maven-plugin </span>to make it work: add following dependency to your pom.xml (see <a href="http://jira.codehaus.org/browse/GRAILS-4574">http://jira.codehaus.org/browse/GRAILS-4574</a> for details):<br />
</span></div>
<pre class="brush:xml">&lt;dependency&gt;
    &lt;groupId&gt;org.tmatesoft.svnkit&lt;/groupId&gt;
    &lt;artifactId&gt;svnkit&lt;/artifactId&gt;
    &lt;version&gt;1.2.3.5521&lt;/version&gt;
    &lt;scope&gt;runtime&lt;/scope&gt;
&lt;/dependency&gt;</pre>
<p style="text-align: justify;"><span style="font-style: normal;"> 6. Now, it&#8217;s time to import your maven project into <span style="color: #333399;">Intellij IDEA </span>(I recommend to use latest EAP <a href="http://www.jetbrains.net/confluence/display/IDEADEV/Maia+EAP">http://www.jetbrains.net/confluence/display/IDEADEV/Maia+EAP</a>). You can do it by <span style="color: #333399;">“Create New Project → Import Project from External Model → Maven&#8230;”</span>. </span></p>
<div class="western" style="text-align: justify;"><span style="font-style: normal;"> Pay attention to Facets that Idea will detect on project import finished. Hint: look in right bottom corner for round icon with “i” on it, if Idea won&#8217;t show you dialog window with detected facets. Facets detection is important to let Idea know that it&#8217;s Grails application. </span></div>
<div class="western"><span style="font-style: normal;"> </span></div>
<div class="western" style="text-align: justify;"><span style="font-style: normal;"> Now close and reopen project again to let JetGroovy plugin use facets and treat application directories in a right way. You should see<span style="color: #333399;"> “Grails:maven-grails-demo”</span> preselected in IDEA&#8217;s run/debug configurations combo. If it&#8217;s so – you on the right way and JetGroovy knows that it&#8217;s Grails application. If not – try to fix it in<span style="color: #99ff99;"> <span style="color: #333399;">“module settings → facets”</span></span>. If you didn&#8217;t make it – contact me, I&#8217;ll try to help.</span></div>
<div class="western" style="text-align: justify;"><span style="font-style: normal;"><br />
</span></div>
<div class="western"><span style="font-style: normal;"> You probably already tried to run application but all you&#8217;ve got was:</span></div>
<pre><span style="font-style: normal;">Exception in thread "main" java.lang.ClassNotFoundException: org.codehaus.groovy.grails.cli.support.GrailsStarter</span><span style="font-style: normal;"> at java.net.URLClassLoader$1.run(URLClassLoader.java:200)</span><span style="font-style: normal;"> at java.security.AccessController.doPrivileged(Native Method)</span><span style="font-style: normal;"> at java.net.URLClassLoader.findClass(URLClassLoader.java:188)</span><span style="font-style: normal;"> at java.lang.ClassLoader.loadClass(ClassLoader.java:307)</span><span style="font-style: normal;"> at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)</span><span style="font-style: normal;"> at java.lang.ClassLoader.loadClass(ClassLoader.java:252)</span><span style="font-style: normal;"> at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)</span><span style="font-style: normal;"> at java.lang.Class.forName0(Native Method)</span><span style="font-style: normal;"> at java.lang.Class.forName(Class.java:169)</span><span style="font-style: normal;"> at com.intellij.rt.execution.application.AppMain.main(AppMain.java:87)</span></pre>
<div style="text-align: justify;"><span style="font-style: normal;"> Don&#8217;t worry. It&#8217;s because grails-maven-plugin depends on grails-core which not contain GrailsStarter. It&#8217;s available in standalone Grails distribution. First of all you are still able to run grails application with <span style="color: #333399;">“Maven Projects → maven-grails-demo → Plugins → grails → grails:run-app” </span>or just by running <span style="color: #333399;">“mvn grails:run-app”</span> from project root. If you still want to run your application from run configuration in Idea you could or create run configuration from Maven goal, by clicking on with right button and selecting appropriate menu item or by installing standalone Grails and telling IDEA where it is. </span></div>
<h4 style="text-align: justify;"><span style="font-style: normal;">Setting up standalone Grails for your application<br />
</span></h4>
<ul>
<li><span style="font-style: normal;">Install  Grails as described <a href="http://grails.org/Installation">http://grails.org/Installation</a>. </span></li>
<li>
<div class="western" style="text-align: justify;"><span style="font-style: normal;">Go to<span style="color: #333399;"> module  settings → Groovy → click “Add&#8230;” → Create new Grails  SDK&#8230; → Tell Idea where your standalone Grails is → Click  “Replace” </span>(not “Add”, important) in dialog appeared</span></div>
</li>
</ul>
<div class="western"><span style="font-style: normal;"> Now you able to run your Grails application directly from Idea with JetGroovy plugin. Enjoy ;)</span></div>
]]></content:encoded>
			<wfw:commentRss>http://grailsgeek.com/2009/06/grails-and-maven2-in-intellij-idea/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>
