<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Agile Orbit</title>
    <description>Agile Development and DevOps
</description>
    <link>http://blog.agileorbit.com/</link>
    <atom:link href="http://blog.agileorbit.com/feed.xml" rel="self" type="application/rss+xml" />
    <pubDate>Fri, 27 Oct 2017 13:42:51 +0000</pubDate>
    <lastBuildDate>Fri, 27 Oct 2017 13:42:51 +0000</lastBuildDate>
    <generator>Jekyll v3.6.2</generator>
    
      <item>
        <title>Unlimited Strength Crypto in Java 8u151+</title>
        <description>&lt;p&gt;Oracle Java Development Kit (JDK) 8u151 &amp;amp; 8u152+ now allows you to set a “crypto.policy Security property in the java.security file” instead of separately downloading &amp;amp; installing the JCE extensions (which everyone seems to struggle with the first time, deployment issues, etc).&lt;/p&gt;

&lt;p&gt;It’s much easier now. Here’s how you can do it per JVM (remember this is only on 8u151+)&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;# Name or location of file can be anything:
$ echo crypto.policy=unlimited &amp;gt; ~/.unlimited.security.properties
$ JAVA_OPTS=-Djava.security.properties=~/.unlimited.security.properties
$ groovysh
groovy:000&amp;gt; println(javax.crypto.Cipher.getMaxAllowedKeyLength(&quot;AES&quot;))
2147483647
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Or system wide:&lt;/p&gt;

&lt;p&gt;edit &lt;code class=&quot;highlighter-rouge&quot;&gt;$JAVA_HOME/jre/lib/security/java.security&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Uncomment&lt;/p&gt;
&lt;div class=&quot;language-diff highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;gd&quot;&gt;-#crypto.policy=unlimited
&lt;/span&gt;&lt;span class=&quot;gi&quot;&gt;+crypto.policy=unlimited
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;One downside of this approach though is that you will have to remember to do this each time you update your JDK.&lt;/p&gt;

&lt;p&gt;JDK 8u152 release notes - &lt;a href=&quot;http://www.oracle.com/technetwork/java/javase/8u152-relnotes-3850503.html#JDK-8157561&quot;&gt;http://www.oracle.com/technetwork/java/javase/8u152-relnotes-3850503.html#JDK-8157561&lt;/a&gt;&lt;/p&gt;
</description>
        <pubDate>Thu, 26 Oct 2017 00:00:00 +0000</pubDate>
        <link>http://blog.agileorbit.com/2017/10/26/unlimited-crypto-java-8u151.html</link>
        <guid isPermaLink="true">http://blog.agileorbit.com/2017/10/26/unlimited-crypto-java-8u151.html</guid>
        
        
      </item>
    
      <item>
        <title>Introducing the Grails Schwartz Plugin</title>
        <description>&lt;p&gt;We are excited to share the release of a new Grails plugin called &lt;a href=&quot;https://github.com/agileorbit/grails-schwartz&quot;&gt;Schwartz&lt;/a&gt;! This new plugin has been in the works for awhile at Agile Orbit and we are excited to finally release it! The plugin is released under the Apache 2.0 open-source license.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Source: &lt;a href=&quot;https://github.com/agileorbit/grails-schwartz&quot;&gt;https://github.com/agileorbit/grails-schwartz&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;Documentation: &lt;a href=&quot;http://blog.agileorbit.com/grails-schwartz/&quot;&gt;http://blog.agileorbit.com/grails-schwartz/&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;Bintray &lt;a href=&quot;https://bintray.com/agileorbit/grails-plugins/schwartz&quot;&gt;https://bintray.com/agileorbit/grails-plugins/schwartz&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The Schwartz plugin integrates the Quartz Enterprise Job Scheduler with Grails, making it easy to schedule and manage recurring and ad-hoc jobs for asynchronous and synchronous processing. The plugin is similar at a high level to the existing &lt;a href=&quot;https://github.com/grails-plugins/grails-quartz&quot;&gt;Quartz&lt;/a&gt; plugin. The two plugins are similar in many ways, but significantly different in others. There are lots of details about the differences in the &lt;a href=&quot;http://blog.agileorbit.com/grails-schwartz/latest/index.html#comparisonWithQuartzPlugin&quot;&gt;extensive plugin documentation&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The documentation also has &lt;a href=&quot;http://blog.agileorbit.com/grails-schwartz/latest/index.html#tutorials&quot;&gt;tutorials&lt;/a&gt; for creating jobs, setting up JDBC tables and clustering.&lt;/p&gt;

&lt;p&gt;We think the Schwartz plugin is a great alternative to the current Quartz plugin! Hopefully you will too! We look forward to hearing your feedback on Schwartz!&lt;/p&gt;
</description>
        <pubDate>Mon, 11 Jul 2016 00:00:00 +0000</pubDate>
        <link>http://blog.agileorbit.com/2016/07/11/Grails-Schwartz-Plugin.html</link>
        <guid isPermaLink="true">http://blog.agileorbit.com/2016/07/11/Grails-Schwartz-Plugin.html</guid>
        
        
      </item>
    
      <item>
        <title>Using http/2 with Grails 3</title>
        <description>&lt;p&gt;Grails 3 uses Tomcat 8 by default, but thanks to Spring Boot it’s easy to change out the underling servlet container to another container such as Undertow or Jetty. One reason to do this would be if you want to take advantage of the different runtime characteristics of Undertow such as http/2 (multiplexing)[0], lightweight memory footprint, and async io (xnio)[1].&lt;/p&gt;

&lt;p&gt;In this quick demo, we’ll show how to switch a Grails 3 app to use Undertow and configure it to use the new http/2 standard.&lt;/p&gt;

&lt;h3 id=&quot;configuration&quot;&gt;Configuration:&lt;/h3&gt;

&lt;p&gt;First, lets comment out Tomcat in favor of Undertow &lt;code class=&quot;highlighter-rouge&quot;&gt;build.gradle&lt;/code&gt;:&lt;/p&gt;

&lt;div class=&quot;language-java highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;n&quot;&gt;dependencies&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;// compile &quot;org.springframework.boot:spring-boot-starter-tomcat&quot;&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;compile&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;org.springframework.boot:spring-boot-starter-undertow&quot;&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Next we have to customize the &lt;code class=&quot;highlighter-rouge&quot;&gt;embeddedServletContainerFactory&lt;/code&gt; bean to setup HTTP/2.&lt;/p&gt;

&lt;p&gt;Add this method to your &lt;code class=&quot;highlighter-rouge&quot;&gt;grails-app/init/&amp;lt;pkg&amp;gt;/Application.groovy&lt;/code&gt;:&lt;/p&gt;

&lt;div class=&quot;language-java highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nd&quot;&gt;@Bean&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;UndertowEmbeddedServletContainerFactory&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;embeddedServletContainerFactory&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(){&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;UndertowEmbeddedServletContainerFactory&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;factory&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;UndertowEmbeddedServletContainerFactory&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;();&lt;/span&gt;

    &lt;span class=&quot;n&quot;&gt;factory&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;addBuilderCustomizers&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;UndertowBuilderCustomizer&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(){&lt;/span&gt;
        &lt;span class=&quot;nd&quot;&gt;@Override&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;customize&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Undertow&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;Builder&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;builder&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;){&lt;/span&gt;
            &lt;span class=&quot;n&quot;&gt;builder&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;setBufferSize&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1024&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;32&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
                    &lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;setIoThreads&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Runtime&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;getRuntime&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;availableProcessors&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
                    &lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;setServerOption&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;UndertowOptions&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;ENABLE_HTTP2&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
                    &lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;setWorkerThreads&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;64&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
                    &lt;span class=&quot;c1&quot;&gt;// There are many more options, see the documentation for more.&lt;/span&gt;
        &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;o&quot;&gt;});&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;factory&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h4 id=&quot;tls&quot;&gt;TLS&lt;/h4&gt;

&lt;p&gt;http/2 does not require a TLS connection per the spec, but Undertow only enables http/2 if the connection is secure. This means we’ll need to setup a private key and certificate.&lt;/p&gt;

&lt;h5 id=&quot;create-and-set-a-keystore&quot;&gt;Create and set a keystore&lt;/h5&gt;

&lt;p&gt;Create a self signed key&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;keytool &lt;span class=&quot;nt&quot;&gt;-genkey&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-keyalg&lt;/span&gt; RSA &lt;span class=&quot;nt&quot;&gt;-alias&lt;/span&gt; selfsigned &lt;span class=&quot;nt&quot;&gt;-keystore&lt;/span&gt; keystore.jks &lt;span class=&quot;nt&quot;&gt;-storepass&lt;/span&gt; password &lt;span class=&quot;nt&quot;&gt;-validity&lt;/span&gt; 360 &lt;span class=&quot;nt&quot;&gt;-keysize&lt;/span&gt; 2048
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;In &lt;code class=&quot;highlighter-rouge&quot;&gt;grails-app/config/application.yml&lt;/code&gt; set the keystore, port and secrets&lt;/p&gt;

&lt;div class=&quot;language-yaml highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;na&quot;&gt;server&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;port&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;8443&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;ssl&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;key-store&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;/path/to/keystore.jks&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;key-store-password&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;changeit&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;key-password&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;password&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h4 id=&quot;get-alpn&quot;&gt;Get ALPN&lt;/h4&gt;

&lt;blockquote&gt;
  &lt;p&gt;ALPN stands for Application Layer Protocol Negotiation, and is a TLS extension that allows a client to negotiate the next protocol to use after the TLS handshake is complete.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;ALPN is currently not included in Java 8. So we’ll have to download it and include it in our Java command options when running with http/2:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;IMPORTANT:&lt;/strong&gt; The version of ALPN is specific to the JDK version you are using. You can find the version for your specific JDK version here: &lt;a href=&quot;https://eclipse.org/jetty/documentation/current/alpn-chapter.html&quot;&gt;https://eclipse.org/jetty/documentation/current/alpn-chapter.html&lt;/a&gt;&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;# When running the app include this in your `-Xbootclasspath/p:`&lt;/span&gt;
wget http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.6.v20151105/alpn-boot-8.1.6.v20151105.jar
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h4 id=&quot;running&quot;&gt;Running&lt;/h4&gt;

&lt;p&gt;To pass the &lt;code class=&quot;highlighter-rouge&quot;&gt;-Xbootclasspath/p&lt;/code&gt; options to Gradle we’ll need to add this at to our &lt;code class=&quot;highlighter-rouge&quot;&gt;bootRun&lt;/code&gt; task in &lt;code class=&quot;highlighter-rouge&quot;&gt;build.gradle&lt;/code&gt;:&lt;/p&gt;

&lt;div class=&quot;language-java highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;n&quot;&gt;bootRun&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;systemProperties&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;System&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;properties&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;# Running in Dev&lt;/span&gt;
./gradlew bootRun &lt;span class=&quot;nt&quot;&gt;-Xbootclasspath&lt;/span&gt;/p:build/libs/alpn-boot-8.1.6.v20151105.jar

&lt;span class=&quot;c&quot;&gt;# Running as standalone jar&lt;/span&gt;
./gradlew assemble
&lt;span class=&quot;nb&quot;&gt;cd &lt;/span&gt;build/libs

&lt;span class=&quot;c&quot;&gt;# Remember to include the alpn lib&lt;/span&gt;
java &lt;span class=&quot;nt&quot;&gt;-Xbootclasspath&lt;/span&gt;/p:alpn-boot-8.1.6.v20151105.jar &lt;span class=&quot;nt&quot;&gt;-jar&lt;/span&gt; myapp.war
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;img src=&quot;/assets/article_images/2016-04-22-http2-grails3/http2.png&quot; /&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;You can see the Protocol Version is listed as &lt;code class=&quot;highlighter-rouge&quot;&gt;HTTP/2.0&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;conclusion&quot;&gt;Conclusion&lt;/h3&gt;

&lt;p&gt;It’s easy to change the container a Grails 3 app is running in to fit your workload. Tomcat, Undertow, and Jetty are all available from Spring Boot to use in Grails 3.&lt;/p&gt;

&lt;h3 id=&quot;notes&quot;&gt;Notes&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;Tested on JDK 8u66, Grails 3.1.5&lt;/li&gt;
  &lt;li&gt;[0] - &lt;a href=&quot;https://http2.github.io/faq/&quot;&gt;https://http2.github.io/faq/&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;[1] - &lt;a href=&quot;http://undertow.io/&quot;&gt;http://undertow.io/&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;http://undertow.io/blog/2015/04/27/An-in-depth-overview-of-HTTP2.html&quot;&gt;http://undertow.io/blog/2015/04/27/An-in-depth-overview-of-HTTP2.html&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/making/demo-http2&quot;&gt;https://github.com/making/demo-http2&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</description>
        <pubDate>Fri, 22 Apr 2016 00:00:00 +0000</pubDate>
        <link>http://blog.agileorbit.com/2016/04/22/http2-grails3.html</link>
        <guid isPermaLink="true">http://blog.agileorbit.com/2016/04/22/http2-grails3.html</guid>
        
        
      </item>
    
      <item>
        <title>Publishing Grails 3 Plugins</title>
        <description>&lt;p&gt;Grails 3 plugins are distributed through &lt;a href=&quot;https://bintray.com&quot;&gt;Bintray&lt;/a&gt;. This is great because it provides everyone the ability to easily publish their own plugins. Bintray is a generic distribution platform and might be a bit overwhelming at first, but it’s a great platform for distribution and it’s also quickly becoming the new de-facto standard for Jars as opposed to &lt;a href=&quot;http://search.maven.org/&quot;&gt;Maven Central&lt;/a&gt;. There are a couple items that newcomers might get stuck on though when publishing their first Grails 3 plugin and this post will hopefully help those users get started.&lt;/p&gt;

&lt;p&gt;If you don’t have a Bintray account, go create one! It’s free and really easy.  Also, if you haven’t read &lt;a href=&quot;https://medium.com/@benorama/how-to-publish-your-grails-3-plugin-to-bintray-c341b24f567d&quot;&gt;this blog post&lt;/a&gt;, please read it and come back when done. It provides a good introduction.&lt;/p&gt;

&lt;p&gt;Now that you have an account and maybe have published a simple plugin, it’s time to hopefully answer a few questions you might have encountered!&lt;/p&gt;

&lt;h3 id=&quot;1-where-is-the-group-id-on-the-bintray-artifact-page&quot;&gt;1) Where is the Group ID on the Bintray artifact page?&lt;/h3&gt;

&lt;p&gt;Maven artifacts are represented as &lt;code class=&quot;highlighter-rouge&quot;&gt;groupId:artifactId:version&lt;/code&gt;. The artifactId and version are easy to find in Bintray, but not the groupId. To find the groupId, you have to go to the file, and click on (i) icon to see the maven/gradle dependency snippet. By default, all Grails plugins use the groupId of &lt;code class=&quot;highlighter-rouge&quot;&gt;org.grails.plugins&lt;/code&gt;, but you can certainly change this if you’d like. There is no hard requirement to use this groupId for your plugin. The groupId is set in &lt;code class=&quot;highlighter-rouge&quot;&gt;build.gradle&lt;/code&gt; like this: &lt;code class=&quot;highlighter-rouge&quot;&gt;group 'org.grails.plugins'&lt;/code&gt;&lt;/p&gt;

&lt;h3 id=&quot;2-i-see-some-grails-plugins-named-orggrailspluginssomething-and-some-named-just-something-what-is-the-correct-bintray-package-naming-standard-for-a-grails-plugin&quot;&gt;2) I see some Grails plugins named “org.grails.plugins:something” and some named just “something”. What is the correct Bintray package naming standard for a Grails plugin?&lt;/h3&gt;

&lt;p&gt;Name it just the short name or the equivalent of the artifactId (&lt;code class=&quot;highlighter-rouge&quot;&gt;something&lt;/code&gt;). Do not put &lt;code class=&quot;highlighter-rouge&quot;&gt;org.grails.plugins&lt;/code&gt; or any other groupId in the Bintray package name. The convention of &lt;code class=&quot;highlighter-rouge&quot;&gt;groupId:artifactId&lt;/code&gt; is from when Maven artifacts were migrated to Bintray and should not be used for new packages. Your Maven repository artifacts in Bintray still have a groupId regardless of what you name the package. I updated the sample publishing artifacts (more details below in #6) to accommodate this recommendation in &lt;a href=&quot;https://github.com/grails/grails-profile-repository/commit/f258d96d41dc8de305dbeff2cdb305c6d8ad3310&quot;&gt;this commit&lt;/a&gt;.&lt;/p&gt;

&lt;h3 id=&quot;3-how-do-i-find-the-actual-project-for-a-bintray-package&quot;&gt;3) How do I find the actual project for a Bintray package?&lt;/h3&gt;

&lt;p&gt;I don’t have a good answer for this question, but rather what I will say is that given Bintray is a completely separate binary management system from Grails, we as a community need to be a little more diligent about ensuring we have correct meta-data for our plugins so community members don’t have to dig for information. For instance, always provide these data elements in &lt;code class=&quot;highlighter-rouge&quot;&gt;gradle.settings&lt;/code&gt; for your plugin:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;websiteUrl = 'https://somebody.github.io/grails-something'
issueTrackerUrl = 'https://github.com/somebody/grails-something/issues'
vcsUrl = 'https://github.com/somebody/grails-something'
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I’m recommending the GitHub Pages URL for a repo (the &lt;code class=&quot;highlighter-rouge&quot;&gt;gh-pages&lt;/code&gt; branch) to always be the website for your plugin since there is no longer a “Grails plugin portal page” for Grails 3 plugins. I would recommend using AsciiDoc to build any new documentation as opposed to the Grails documentation engine. You can see a good example of AsciiDoc being used for plugin documentation &lt;a href=&quot;https://github.com/grails-plugins/grails-spring-security-cas/tree/master/src/docs&quot;&gt;here&lt;/a&gt;. These URLs will then show up on the Bintray package page and make it easy for users to find the source.&lt;/p&gt;

&lt;h3 id=&quot;4-how-do-i-change-the-name-of-my-plugin&quot;&gt;4) How do I change the name of my plugin?&lt;/h3&gt;

&lt;p&gt;I like the convention of starting Grails plugin GitHub repos with &lt;code class=&quot;highlighter-rouge&quot;&gt;grails-&lt;/code&gt; in the name. By default, Gradle takes the name of the root folder as the artifactId though. So, that would make the artifact called &lt;code class=&quot;highlighter-rouge&quot;&gt;grails-something&lt;/code&gt; which obviously isn’t what we want. We want our plugin to be published as &lt;code class=&quot;highlighter-rouge&quot;&gt;something&lt;/code&gt;. This is easy to fix though by creating a &lt;code class=&quot;highlighter-rouge&quot;&gt;settings.gradle&lt;/code&gt; file in the root of our plugin repo with one attribute &lt;code class=&quot;highlighter-rouge&quot;&gt;rootProject.name = &quot;something&quot;&lt;/code&gt;.&lt;/p&gt;

&lt;h3 id=&quot;5-what-does-linking-my-package-mean-and-how-do-i-get-my-plugin-to-be-listed-as-a-grails-3-plugin&quot;&gt;5) What does “linking” my package mean and how do I get my plugin to be listed as a “Grails 3 plugin”?&lt;/h3&gt;

&lt;p&gt;Every Bintray user has their own repositories and your packages will be published to one of them. To use these binaries, you need to add your repository to your build file for dependency resolution (i.e. places to look for dependencies). Linking simply means add my package to another repository other than the one I published it to. For example, there is a big repository in Bintray called &lt;a href=&quot;https://bintray.com/bintray/jcenter&quot;&gt;jcenter&lt;/a&gt; that you can link your artifacts with so that other users don’t have add your repository since a lot of people already have jcenter listed as a repository in their build file. Well, we have the same concept with the &lt;a href=&quot;https://bintray.com/grails/plugins&quot;&gt;Grails Plugins repository&lt;/a&gt;. By linking your Grails plugin with that repository, users will not have to add your repository to find it and it will show up as a Grails 3 plugin! This is certainly not required, but it will be much easier for other community members to find and use your plugin if you link it with the &lt;a href=&quot;https://bintray.com/grails/plugins&quot;&gt;Grails Plugins repository&lt;/a&gt;.&lt;/p&gt;

&lt;h3 id=&quot;6-what-are-these-apply-from-httpsrawgithubusercontentcomgrailsgrails-profile-repository-lines-in-my-plugin-build-file&quot;&gt;6) What are these “apply from: https://raw.githubusercontent.com/grails/grails-profile-repository/…” lines in my plugin build file?&lt;/h3&gt;

&lt;p&gt;Those two lines simply include &lt;code class=&quot;highlighter-rouge&quot;&gt;bintray&lt;/code&gt; and &lt;code class=&quot;highlighter-rouge&quot;&gt;publishing&lt;/code&gt; sections in your build file and can be considered a guide for how to configure these settings. These are actually going away for Grails 3.1+ though as there will be a &lt;a href=&quot;https://github.com/grails/grails-core/tree/master/grails-gradle-plugin&quot;&gt;new plugin&lt;/a&gt; for helping with publishing. You can see in &lt;a href=&quot;https://github.com/grails/grails-core/commit/3e2787b08489612b05f6d0ad1bdd65fe688842e7&quot;&gt;this commit&lt;/a&gt; that I applied the same recommendation from #2 for naming Bintray packages to be just the artifactId.&lt;/p&gt;

&lt;h3 id=&quot;7-what-is-the-grails-plugin-attribute-in-bintray-publishing&quot;&gt;7) What is the “grails-plugin” attribute in Bintray publishing?&lt;/h3&gt;

&lt;p&gt;That &lt;a href=&quot;https://github.com/grails/grails-profile-repository/blob/master/profiles/plugin/templates/bintrayPublishing.gradle#L17&quot;&gt;grails-plugin&lt;/a&gt; attribute is simply meta-data to query Bintray to find packages. Attributes can be added to repositories, packages and versions. In the future, if there is a separate plugin portal we can leverage the &lt;code class=&quot;highlighter-rouge&quot;&gt;grails-plugin&lt;/code&gt; attribute to quickly find plugins in Bintray. Obviously having your plugin(s) added to the &lt;a href=&quot;https://bintray.com/grails/plugins&quot;&gt;Grails Plugins repository&lt;/a&gt; in Bintray accomplishes the same thing though.&lt;/p&gt;

&lt;p&gt;I hope you found this post helpful in answering some questions about publishing Grails 3 plugins. Thanks for reading!&lt;/p&gt;
</description>
        <pubDate>Wed, 07 Oct 2015 00:00:00 +0000</pubDate>
        <link>http://blog.agileorbit.com/2015/10/07/Publishing-Grails-3-Plugins.html</link>
        <guid isPermaLink="true">http://blog.agileorbit.com/2015/10/07/Publishing-Grails-3-Plugins.html</guid>
        
        
      </item>
    
      <item>
        <title>Spring Session Redis with Grails 3</title>
        <description>&lt;p&gt;Managing sessions outside of your app/JVM provides flexibility with deployments and it makes both blue/green and zero downtime deployments possible. Previously, this required setting up a session manager in Tomcat, but with Grails 3 it’s much easier.&lt;/p&gt;

&lt;p&gt;Since Grails 3 is based on SpringBoot, we can easily use the &lt;a href=&quot;https://github.com/spring-projects/spring-session/&quot;&gt;Spring Session&lt;/a&gt; project (along with &lt;a href=&quot;http://projects.spring.io/spring-data-redis/&quot;&gt;spring-data-redis&lt;/a&gt;) to persist session information outside Tomcat and utilize &lt;a href=&quot;http://redis.io/&quot;&gt;Redis&lt;/a&gt; - a distributed key/value store.&lt;/p&gt;

&lt;h3 id=&quot;configuration&quot;&gt;Configuration:&lt;/h3&gt;
&lt;p&gt;First, lets add Spring Session and Redis to our &lt;code class=&quot;highlighter-rouge&quot;&gt;build.gradle&lt;/code&gt;:&lt;/p&gt;

&lt;div class=&quot;language-java highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;n&quot;&gt;dependencies&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;compile&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;org.springframework.session:spring-session:1.1.1.RELEASE&quot;&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;compile&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;org.springframework.boot:spring-boot-starter-redis&quot;&lt;/span&gt;
    &lt;span class=&quot;o&quot;&gt;...&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Next, tell Grails where the Redis server is located in &lt;code class=&quot;highlighter-rouge&quot;&gt;application.yml&lt;/code&gt;:&lt;/p&gt;

&lt;div class=&quot;language-yaml highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;na&quot;&gt;spring&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;redis&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;host&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;localhost&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;port&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;6379&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;server&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;session-timeout&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;3600&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;# session timeout in seconds&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;For Grails &lt;strong&gt;3.1.x&lt;/strong&gt; that’s it! Grails &lt;strong&gt;3.0.x&lt;/strong&gt; needs a &lt;a href=&quot;#3.0.x&quot;&gt;ordering fix&lt;/a&gt;&lt;/p&gt;

&lt;h3 id=&quot;verification&quot;&gt;Verification&lt;/h3&gt;

&lt;p&gt;Start up your app and browse to a page. You should see the session stored in Redis:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;grails run-app
&lt;span class=&quot;c&quot;&gt;# put something on the session,&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#  eg: session.foo = &quot;bar&quot; in a controller&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#  or login to your app if you have security setup&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;redis-cli keys &lt;span class=&quot;s1&quot;&gt;'*'&lt;/span&gt;
1&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;spring:session:expirations:1441301640000&quot;&lt;/span&gt;
2&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;spring:session:sessions:91dcfa08-00e1-4cab-98c2-34bf0da40184&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;conclusion&quot;&gt;Conclusion&lt;/h3&gt;

&lt;p&gt;With two dependancies, one class, and a little yml we’ve added the ability to store sessions outside of Tomcat and share them with multiple JVMs!&lt;/p&gt;

&lt;p&gt;You will now be able to:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Stop and start the app and still have the values for your session&lt;/li&gt;
  &lt;li&gt;Users will not be logged out between deployments&lt;/li&gt;
  &lt;li&gt;Orchestrate a blue/green or canary deployment without downtime&lt;/li&gt;
  &lt;li&gt;Ability to share sessions across multiple JVMs on the same or different servers and round-robbin between them without loosing the session.&lt;/li&gt;
  &lt;li&gt;Redis data is persisted to disk so sessions will survive a server restart&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;With Grails 3 we have all the power of SpringBoot. My key takeaway from this is to not limit yourself to just Grails Plugins with a Grails 3 app and to take a look at the SpringBoot ecosystem as well.&lt;/p&gt;

&lt;p&gt;Checkout my talk at &lt;a href=&quot;https://www.youtube.com/watch?v=9I8fyX7qnoU&quot;&gt;Gr8Conf US 2015&lt;/a&gt; for this and a lot of other topics related to running and building a Grails app for production.&lt;/p&gt;

&lt;h3 id=&quot;notes&quot;&gt;Notes&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;Tested on JDK 8u60, Grails 3.1.4, Redis 3.0.3&lt;/li&gt;
  &lt;li&gt;Tested with Grails Spring Security Plugin 3.0.4&lt;/li&gt;
  &lt;li&gt;Install Redis &lt;code class=&quot;highlighter-rouge&quot;&gt;brew install redis&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;Run Redis &lt;code class=&quot;highlighter-rouge&quot;&gt;redis-server&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;Full working example is now in spring-session &lt;a href=&quot;https://github.com/spring-projects/spring-session/tree/master/samples/grails3&quot;&gt;https://github.com/spring-projects/spring-session/tree/master/samples/grails3&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;30x&quot;&gt;3.0.x&lt;/h3&gt;

&lt;p&gt;To fix an ordering issue in Grails 3.0.x add a new class to tie everything together under &lt;code class=&quot;highlighter-rouge&quot;&gt;grails-app/init/&amp;lt;yourapp&amp;gt;/SessionConfig.groovy&lt;/code&gt;.&lt;/p&gt;

&lt;div class=&quot;language-java highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;kn&quot;&gt;package&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;yourapp&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;

&lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;org.springframework.boot.context.embedded.FilterRegistrationBean&lt;/span&gt;
&lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;org.springframework.context.annotation.Bean&lt;/span&gt;
&lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;org.springframework.context.annotation.Configuration&lt;/span&gt;
&lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;org.springframework.core.Ordered&lt;/span&gt;
&lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;org.springframework.session.data.redis.config.annotation.web.http.EnableRedisHttpSession&lt;/span&gt;
&lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;org.springframework.session.ExpiringSession&lt;/span&gt;
&lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;org.springframework.session.web.http.SessionRepositoryFilter&lt;/span&gt;

&lt;span class=&quot;nd&quot;&gt;@EnableRedisHttpSession&lt;/span&gt;
&lt;span class=&quot;nd&quot;&gt;@Configuration&lt;/span&gt;
&lt;span class=&quot;kd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;SessionConfig&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;

    &lt;span class=&quot;cm&quot;&gt;/**
     * By Default SessionRepositoryFilter is registered as +50, but we need it to be before GrailsWebRequestFilter which is registered at +30. This
     * overrides the default order.
     * This override is not needed after SpringBoot 1.3.0.M5+ is included in Grails.
     */&lt;/span&gt;
    &lt;span class=&quot;nd&quot;&gt;@Bean&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;FilterRegistrationBean&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;springSessionFilterRegistration&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;SessionRepositoryFilter&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;?&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;extends&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;ExpiringSession&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;filter&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;FilterRegistrationBean&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;filter:&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;filter&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;order:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Ordered&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;HIGHEST_PRECEDENCE&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;15&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;You will need to register this bean in &lt;code class=&quot;highlighter-rouge&quot;&gt;grails-app/conf/spring/resources.groovy&lt;/code&gt; or simply add &lt;code class=&quot;highlighter-rouge&quot;&gt;@ComponentScan&lt;/code&gt; to your &lt;code class=&quot;highlighter-rouge&quot;&gt;grails-app/init/&amp;lt;yourapp&amp;gt;/Application.groovy&lt;/code&gt; class:&lt;/p&gt;

&lt;div class=&quot;language-java highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;o&quot;&gt;...&lt;/span&gt;
&lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;org.springframework.context.annotation.ComponentScan&lt;/span&gt;

&lt;span class=&quot;nd&quot;&gt;@ComponentScan&lt;/span&gt;
&lt;span class=&quot;kd&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Application&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;extends&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;GrailsAutoConfiguration&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;kd&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;main&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;[]&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;args&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;GrailsApp&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;run&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Application&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;args&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
</description>
        <pubDate>Fri, 04 Sep 2015 00:00:00 +0000</pubDate>
        <link>http://blog.agileorbit.com/2015/09/04/Spring-Session-Redis-Grails-3.html</link>
        <guid isPermaLink="true">http://blog.agileorbit.com/2015/09/04/Spring-Session-Redis-Grails-3.html</guid>
        
        
      </item>
    
      <item>
        <title>Using Centos 7 with runnable jars in Grails 3 or SpringBoot</title>
        <description>&lt;p&gt;The pattern of embedding the servlet container and the application into one runnable Jar is a great way to package and run your Grails 3 / Spring Boot applications.  It provides flexibility to use different containers (Tomcat, Jetty, etc) and makes deployment a breeze.  We’ve been using this pattern to run applications for awhile now and wanted to share some tips for running them on Centos 7.&lt;/p&gt;

&lt;h3 id=&quot;running-jars-as-a-service&quot;&gt;Running jars as a service&lt;/h3&gt;
&lt;p&gt;The first thing you’ll notice in Centos7 is that creating a service to run your app got a whole lot easier with &lt;code class=&quot;highlighter-rouge&quot;&gt;systemd&lt;/code&gt;, but may feel unfamiliar at first.  Here’s an example of a &lt;code class=&quot;highlighter-rouge&quot;&gt;systemd&lt;/code&gt; service in &lt;code class=&quot;highlighter-rouge&quot;&gt;/etc/systemd/system/myapp.service&lt;/code&gt;.&lt;/p&gt;

&lt;div class=&quot;language-ini highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nn&quot;&gt;[Unit]&lt;/span&gt;
&lt;span class=&quot;py&quot;&gt;Description&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;MyApp Java Daemon&lt;/span&gt;

&lt;span class=&quot;nn&quot;&gt;[Service]&lt;/span&gt;
&lt;span class=&quot;py&quot;&gt;ExecStart&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;/usr/bin/java -jar /opt/myapp/myapp-0.1.0.jar&lt;/span&gt;
&lt;span class=&quot;py&quot;&gt;User&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;centos&lt;/span&gt;

&lt;span class=&quot;nn&quot;&gt;[Install]&lt;/span&gt;
&lt;span class=&quot;py&quot;&gt;WantedBy&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;multi-user.target # Similar to runlevel 5&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Thats it! Much cleaner than those huge init.d scripts we’re used to.&lt;/p&gt;

&lt;p&gt;There are a lot more options, checkout the man page here - &lt;a href=&quot;http://www.freedesktop.org/software/systemd/man/systemd.service.html&quot;&gt;http://www.freedesktop.org/software/systemd/man/systemd.service.html&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Starting, stopping and retrieving logs has changed as well:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;systemctl daemon-reload &lt;span class=&quot;c&quot;&gt;# Reload systemd config from disk&lt;/span&gt;
systemctl &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;start|stop|status] myapp.service &lt;span class=&quot;c&quot;&gt;# similar to service myapp start&lt;/span&gt;
systemctl &lt;span class=&quot;nb&quot;&gt;enable &lt;/span&gt;myapp.service &lt;span class=&quot;c&quot;&gt;# set service to start onboot&lt;/span&gt;
journalctl &lt;span class=&quot;nt&quot;&gt;-u&lt;/span&gt; myapp.service &lt;span class=&quot;nt&quot;&gt;-f&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;# -f tails stdout logs&lt;/span&gt;
journalctl &lt;span class=&quot;nt&quot;&gt;-u&lt;/span&gt; myapp.service &lt;span class=&quot;nt&quot;&gt;--since&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;00:00 &lt;span class=&quot;nt&quot;&gt;--until&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;9:30 &lt;span class=&quot;c&quot;&gt;# filter on a time period&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;new-security-settings&quot;&gt;New Security settings&lt;/h2&gt;
&lt;p&gt;Centos 7 is a bit stricter with SELinux than you may be used to, which is a good thing but can catch you off guard. SELinux has been around for a while and you can fix most issues by googling them these days. Here’s a few we ran into.&lt;/p&gt;

&lt;h3 id=&quot;proxying-fromto-localhost&quot;&gt;Proxying from/to localhost&lt;/h3&gt;
&lt;p&gt;If you’re running nginx or apache httpd as a reverse proxy on the same host as your java app you’ll need to allow the httpd connection -&lt;/p&gt;
&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;setsebool &lt;span class=&quot;nv&quot;&gt;httpd_can_network_connect&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;1
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;If you’re using Chef to manage your infrastructure you can use the &lt;a href=&quot;https://supermarket.chef.io/cookbooks/selinux_policy&quot;&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;selinux_policy&lt;/code&gt;&lt;/a&gt; cookbook as well:&lt;/p&gt;

&lt;div class=&quot;language-ruby highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;n&quot;&gt;selinux_policy_boolean&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'httpd_can_network_connect'&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;value&lt;/span&gt; &lt;span class=&quot;kp&quot;&gt;true&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;notifies&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:restart&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'service[nginx]'&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;More &lt;code class=&quot;highlighter-rouge&quot;&gt;selinux&lt;/code&gt; settings can be found here - &lt;a href=&quot;http://wiki.centos.org/TipsAndTricks/SelinuxBooleans&quot;&gt;http://wiki.centos.org/TipsAndTricks/SelinuxBooleans&lt;/a&gt;&lt;/p&gt;

&lt;h3 id=&quot;permissions&quot;&gt;Permissions&lt;/h3&gt;
&lt;p&gt;Along with &lt;code class=&quot;highlighter-rouge&quot;&gt;chown&lt;/code&gt; and &lt;code class=&quot;highlighter-rouge&quot;&gt;chmod&lt;/code&gt; we also have &lt;code class=&quot;highlighter-rouge&quot;&gt;chcon&lt;/code&gt; (&lt;a href=&quot;http://www.linuxcommand.org/man_pages/chcon1.html&quot;&gt;change security context&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;To allow httpd to read keys stored outside it’s predefined directories you can run&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;chcon unconfined_u:object_r:httpd_config_t:s0 /etc/pki/tls/certs/mysite.crt
chcon unconfined_u:object_r:httpd_config_t:s0 /etc/pki/tls/certs/intermediate.ca
chcon unconfined_u:object_r:httpd_config_t:s0 /etc/pki/tls/private/mysite.key
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;chcon&lt;/code&gt; changes are temporary and won’t survive if the the security context is reapplied. To permanently add this context to the system use &lt;a href=&quot;http://docs.fedoraproject.org/en-US/Fedora/21/html/SELinux_Users_and_Administrators_Guide/sect-Security-Enhanced_Linux-SELinux_Contexts_Labeling_Files-Persistent_Changes_semanage_fcontext.html&quot;&gt;semanage fcontext&lt;/a&gt;.&lt;/p&gt;

&lt;h3 id=&quot;selinux-logs&quot;&gt;selinux logs&lt;/h3&gt;
&lt;p&gt;You can find the logs for &lt;code class=&quot;highlighter-rouge&quot;&gt;selinux&lt;/code&gt; in &lt;code class=&quot;highlighter-rouge&quot;&gt;/var/log/audit/audit.log&lt;/code&gt;. They should provide enough detail to find what you need via google.&lt;/p&gt;

&lt;h3 id=&quot;grails-2&quot;&gt;Grails 2?&lt;/h3&gt;
&lt;p&gt;If you’re using Grails 2.x you can still build runnable jars with this plugin &lt;a href=&quot;https://grails.org/plugin/standalone&quot;&gt;https://grails.org/plugin/standalone&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;We hope this helps you deploying your runnable jars. If you have some other tips or need help building and deploying your Java apps drop us an email at &lt;a href=&quot;mailto:info@agileorbit.com&quot;&gt;info@agileorbit.com&lt;/a&gt;. I will also be speaking at GR8Conf US 2015 on this and much more &lt;a href=&quot;http://gr8conf.us/#/talk/130&quot;&gt;http://gr8conf.us/#/talk/130&lt;/a&gt;&lt;/p&gt;
</description>
        <pubDate>Fri, 15 May 2015 00:00:00 +0000</pubDate>
        <link>http://blog.agileorbit.com/2015/05/15/Using-Centos-7-with-runnable-jars-in-Grails-3-or-SpringBoot.html</link>
        <guid isPermaLink="true">http://blog.agileorbit.com/2015/05/15/Using-Centos-7-with-runnable-jars-in-Grails-3-or-SpringBoot.html</guid>
        
        
      </item>
    
      <item>
        <title>APIs with Grails 3 and OAuth 2</title>
        <description>&lt;p&gt;Welcome to the Agile Orbit blog! In this post, we will dive into APIs with
Grails 3 and OAuth 2!&lt;/p&gt;

&lt;p&gt;It you’re like most Grails developers, the first thing you typically do when
creating a new Grails application is you install the Spring Security Core plugin.
This has been great for helping jump start development, but it’s also a hinderance
to actually learning the Spring Security library. As this screencast will demonstrate,
you actually don’t even need plugins for security with Grails 3, but rather
we can use the Spring Boot Security Starter and other Spring Security libraries directly
in our Grails 3 application.&lt;/p&gt;

&lt;iframe width=&quot;420&quot; height=&quot;315&quot; src=&quot;https://www.youtube.com/embed/k_6Qa-6-paA&quot; frameborder=&quot;0&quot; allowfullscreen=&quot;&quot;&gt;&lt;/iframe&gt;

&lt;p&gt;One of the goals of this screencast is to create a golden sample for Grails 3 with OAuth 2
for others to use as a starting point for their own Grails 3 APIs. If you have any ideas for improvements or additions, please feel free to fork the repo and create a pull request! As shown in the screencast, all the source-code is available in this repo:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/bobbywarner/grails3-oauth2-api&quot;&gt;https://github.com/bobbywarner/grails3-oauth2-api&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thanks for watching and please check back soon for more posts on the Agile Orbit blog.&lt;/p&gt;
</description>
        <pubDate>Mon, 11 May 2015 00:00:00 +0000</pubDate>
        <link>http://blog.agileorbit.com/2015/05/11/Grails3-OAuth2.html</link>
        <guid isPermaLink="true">http://blog.agileorbit.com/2015/05/11/Grails3-OAuth2.html</guid>
        
        
      </item>
    
      <item>
        <title>Hello World</title>
        <description>&lt;p&gt;Welcome to the new Agile Orbit tech blog! Agile Orbit is a technology consulting company based out of Minneapolis, Minnesota. We bring web and mobile technology to life using innovative and cost-effective solutions. We architect, develop, and deliver software solutions for our customers using agile development, best practices, and coach teams on integrating continuous delivery into their projects&lt;/p&gt;

&lt;h3 id=&quot;what-does-agile-mean&quot;&gt;What does Agile mean?&lt;/h3&gt;

&lt;p&gt;Agile means different things to different people in the software industry. Here is what it means to us: Individuals and interactions over processes and tools, working software over comprehensive documentation, customer collaboration over contract negotiation and responding to change over following a plan. We certainly didn’t make these principles up on our own though as they are directly from the Agile Manifesto.&lt;/p&gt;

&lt;h3 id=&quot;what-does-orbit-mean&quot;&gt;What does Orbit mean?&lt;/h3&gt;

&lt;p&gt;Orbit is not a common term in the software industry, but it is the term we use to describe continuous integration and continuous delivery. We believe everything in a project needs to work like an orbit. The development and release processes need to be predictable, dependable and circular. There is no such thing as one big implementation on our projects as we are continuously implementing throughout the entire project and gathering feedback from our customers at every step along the way.&lt;/p&gt;
</description>
        <pubDate>Tue, 28 Apr 2015 00:00:00 +0000</pubDate>
        <link>http://blog.agileorbit.com/2015/04/28/Hello-World.html</link>
        <guid isPermaLink="true">http://blog.agileorbit.com/2015/04/28/Hello-World.html</guid>
        
        
      </item>
    
  </channel>
</rss>
