Batman logo made with tetromino shapes (Tetris blocks)

My lovely wife signed me up for Lootcrate for Christmas. In the latest was a set of 147 tetromino shaped stickers from Tetris. I wasn’t satisfied with just using my name (the set comes with a design book on how to make the entire alphabet). So instead, I went with the Dark Knight’s logo made… Read More »

Using system properties in with Spring

This is actually pretty easy to pull off. First you must use a property-placeholder like this: [xml] <context:property-placeholder location="classpath:myapp.properties" system-properties-mode="ENVIRONMENT"/> [/xml] The system-properties-mode supports several options including: FALLBACK – Indicates placeholders should be resolved against any local properties and then against system properties NEVER – Indicates placeholders should be resolved only against local properties and… Read More »

Using PowerMock to mock a call to super

Let’s say you are wanting to test UberEmployee below: [java] public class Employee { public int calculatePay() { return someComplexCalculations; } } public class UberEmployee { public static final long UBER_BONUS = 1000; @Override public int calculatePay() { return super.calculatePay() + 1000; } } [/java] Perhaps you can’t change Employee but you still want to… Read More »

Keeping passwords secret: Hudson plugin development

A common problem with several Hudson plugins is storing passwords and other sensitive data as plaintext as seen here, here, here, and here. There are more examples than I’d care to list here. What prompted me to write this is a bug in the email-ext that I just fixed where credentials were being stored in… Read More »

Redirect root directory to a subdirectory using .htaccess

Every so often I need to redirect from the root directory http://www.someserver.com to http://www.someserver.com/blah. The first thing I try is always something like: [text] # This does not work RedirectMatch permanent / /blah [/text] This ends up not working with Firefox reporting “the page isn’t redirecting properly”. I guess the server gets confused and redirects… Read More »

Triggering Hudson builds with Mercurial hooks

Mercurial offers a variety of hooks, powerful triggers that can be configured to automatically perform automated tasks after an event occurs in a repository. We can leverage Mercurial’s changegroup hook to make Hudson build a project without polling the version control system for changes. This offers some important advantages and disadvantages. One advantages of triggering… Read More »

Axis2, Maven, and java.net woes and why Maven sucks

I had some interesting problems trying to use the Axis2’s Maven plugin (1.5.1) for generating java code from a WSLD. Here’s what I did to get it working. First thing’s first I had to define the plugin in my POM: [xml] <plugin> <groupId>org.apache.axis2</groupId> <artifactId>axis2-wsdl2code-maven-plugin</artifactId> <version>1.5.1</version> <executions> <execution> <phase>generate-sources</phase> <goals> <goal>wsdl2code</goal> </goals> </execution> </executions> <configuration> <packageName>com.ashlux.myproject</packageName>… Read More »