Monday, June 01, 2009

Maven and Google Code

I have a few projects I keep on Google Code. Since I do quite a bit of work using Maven and Java, it's nice to be able to use the subversion repo on Google Code to host my maven repo and my javadocs. Notes for hosting a Maven repo can be found at http://www.jroller.com/mrdon/entry/find_of_the_day_wagon and Javadoc details are at http://stuffthathappens.com/blog/2007/11/09/howto-publish-javadoc-on-google-code/

Thursday, March 05, 2009

Adding Log4j DOCTYPE to log4j.xml

If you're using an XML aware editor, it's nice to take advantage of built in XML validation when editing log4j.xml configuration files. Here's a DOCTYPE that works with these editors:
<!DOCTYPE log4j:configuration PUBLIC 
        "-//LOG4J//DTD LOG4J 1.2//EN" 
        "http://svn.apache.org/viewvc/logging/log4j/trunk/src/main/resources/org/apache/log4j/xml/log4j.dtd?view=co">

Tuesday, December 02, 2008

Generating a task list from JIRA issues using XML-RPC and Groovy

This is just a quick note demonstrating how to generate a task list from issues entered into JIRA. I use TaskPaper for creating GTD-style task lists for work and thought it might be handy to tack issues assigned to me in our JIRA issue tracker in the same way. To do so do the following:
  1. Install Groovy
  2. Download the Groovy XML-RPC module and copy it to $HOME/.groovy/lib
  3. Create a filter in JIRA to return tasks that you're interested in. Make note of the filterIdfor the filter you created.
  4. Create a shell script, here I'll call it jiratasks.groovy, and copy the following code into it:
    #!/usr/bin/env groovy
    import groovy.net.xmlrpc.XMLRPCServerProxy
    import java.text.SimpleDateFormat
    
    // Included to make pretty dates
    def dateFormat1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")
    def dateFormat2 = new SimpleDateFormat("yyyy-MM-dd")
    
    // Connect to your server
    //Your URL may vary
    def server = new XMLRPCServerProxy("https://your.jira.server.net/rpc/xmlrpc") 
    def jira = server.jira1
    // Subsitute your username and password here
    def token = jira.login("your_username", "your_password")
    // Replace "10021" with your filterId  
    def issues = jira.getIssuesFromFilter(token, "10021")  
    
    // Sort by priority
    issues.sort { it.priority }
    
    // Get a list of projects
    def projects = issues.collect { it["project"]}
    projects.unique().sort()
    
    println "JIRA Issues:"
    projects.each { project ->
      println("\t${project}:")
      issues.each { issue ->
        if (issue["project"] == project) {
          def creationDate = dateFormat2.format(dateFormat1.parse(issue.created))
          println("\t- ${issue.key}: ${issue.summary} @created(${creationDate})")
        }
      }
    }
    
    jira.logout(token)
      
  5. Run it like: jiratasks.groovy > JIRATasks.taskpaper
  6. Voila. A GTD style tasks list that works with TaskPaper

Wednesday, June 04, 2008

Spinning up on Google Guice

I'm spinning up on using dependency-injection for a new desktop app. Here's a few references to get me going: more to come...