I just released the first public version of Spring Security Acl with Mongodb as the data store at https://bitbucket.org/tinhtruong/spring-security-acl-mongodb. Inspired from Spring implementation based on JDBC, I leverage the power of the Spring Data Mongodb to implement the retrieve strategy for ACL stuff. The implementation is based on Spring Security 3.1.0.RELEASE (the latest version at this time).

It is released under Apache 2.0 license, so you can use it in your commercial projects.

I use Gradle as the build system. So if you want to build from the source, make sure you have an up-and-running Gradle 1.0. To create a jar:

gradle jar

Feedback are welcome!

In my previous post, I successfully managed to put all the output of Maven (and Eclipse) into RAM to reduce the disk write. In today post, I will do the same thing but with Gradle. Here is my build.gradle

apply plugin: "java"
apply plugin: "war"
apply plugin: "eclipse"

sourceCompatibility = 1.6
targetCompatibility = 1.6

group = "me.tinhtruong"
version = "1.0"

repositories {
    mavenCentral()
}

dependencies {
    compile "com.icegreen:greenmail:1.3.1b"
    compile "jstl:jstl:1.2"
    providedCompile "javax.servlet:servlet-api:2.5"
}
// Change the buildDir of the current project to /tmp/ (which is mounted on RAM using tmpfs)
buildDir = new File("/tmp/gradle/" + project.name);

// First, create a linked resource pointing to our Gradle buildDir, then hook into the .classpath file generation of Gradle to change the output of Eclipse to that linked resource.
eclipse {
 project {
  linkedResource name: 'build', type:'2', location: buildDir.absolutePath
 }
 classpath {
  file {
   whenMerged { classpath ->
    classpath.entries.each { entry ->
     if (entry.kind == 'output') {
      entry.path = 'build/eclipse-output';
     }
    }
   }
  }
 }
}
I've been exposing to Gradle for a couple of weeks and really like it. As a Maven user, I found that Gradle is a refreshing methodology on how a build tool should be. But one thing I miss from the Maven land: the ability to generate the initial structure for a project (I mean the 'archetype' plugin of Maven). Luckily, due to the plugin architecture of Gradle, a Gradle user has developed a plugin just for that purpose. It's called the 'tempaltes' plugin. The wiki page of the plugin gives you all the details you need to install, but the global installation section is confusing and did not work. Here is how I did to make it work:
  • Create a file called templates.gradle in the ~/.gradle/init.d/ folder (actually you can name it whatever you want as long as it has the extension .gradle)
  • Edit that file and paste this little code snippet:
gradle.beforeProject { prj ->
   prj.apply from: 'http://launchpad.net/gradle-templates/trunk/latest/+download/apply.groovy'
}
Now, you can create a project structure event without a build.gradle with the command:
gradle createJavaProject
Happy coding!