Author Archive

Tricking Continuum : Self-Dependencies and the Antrun Plugin

Wednesday, October 24th, 2007

A project I’m working on was recently added to continuum to track build success. Unfortunately, we had to include the maven antrun plugin to handle two self-dependencies that the project has. I say unfortunate, because it made life hell to get the project to build when we changed version numbers. But, I have a solution.

The theory:
- before changing the version of the project, create the future version’s self-dependency jars.
- to do that, we need to change the antrun scripts to create new jars that will be used in the next project version. Commit to subversion and run continuum build.
- then we can change the pom to the next project version and when run in continuum it uses the jar created by the last version of the project. Maven2 then thinks it has the right jar, so the dependencies pass. The antrun scripts then fire off, and create the correct new jars that will be included in the project build.

The Implementation:
- if we’re on version 32, then change the scripts to create jars for version 33, and leave the project as version 32. Commit to subversion, then in continuum run build. Now we have project 32 that created jar 33 for us.
- The version for the project can finally be updated to 33, committed to subversion, and run successfully in continuum builds.

Now, for those of you not familiar with how to get antrun working in maven2, you need to add in the pom.xml in the plugins section:


<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<phase>generate-resources</phase>
<configuration>
<tasks>
<echo message="To skip install modify pom to not include maven-antrun-plugin"/>
<exec
dir="${basedir}"
executable="${basedir}/installLib.sh"
failonerror="true" />
<exec
dir="${basedir}"
executable="${basedir}/installXmlbeans.sh"
failonerror="true" />
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>

For the installXmlbeans script we have something like the following: (directory xsd contains those files to be converted to xml beans)

VERSION=33
touch src/main/xsd/*
mvn -P installer xmlbeans:xmlbeans
mvn -P installer install:install-file -Dfile=target/projectname-xmlbeans.jar -DgroupId=com.twopaths.projectname -DartifactId=projectname-xmlbeans -Dversion=$VERSION -Dpackaging=jar

Hopefully this saves other people from the same continuum self-dependency versioning hell.

-Garrett

The Outer Limits of the Java Time Zone

Thursday, July 19th, 2007

Recently I was irritated with some major headaches caused by Java’s date/time functionality. I spent a couple days debugging my code, and stepping through every possibility until coming to the realization, my code worked. So what was causing the discrepancy with my local machine, and the staging server?

Apparently java uses /etc/localtime on linux, and the server I was having trouble with was not using a symlink to the correct timezone for it’s local time. This is apparently the correct behaviour in linux but leads to problems with the JVM. Instead the JVM had a self managed clock, and this was set to the wrong time zone. Changing the localtime to a symlink solved the issue.

More detailed information on what causes this, and how to solve the problem when it occurs can be found here.

-Garrett

A Dev’s Life @ 2paths

Thursday, February 1st, 2007

My Background:
I joined the team in May of 2006.
Basically a fresh graduate from the computer science department of the University of Manitoba.
Studied typical computer stuff, such as DB, UI, AI, software engineering, networking, applied mathematics. Completed a business minor from the Asper School of business, where my primary courses were international market and business theory.
I had worked for close to a year in Winnipeg for a financial planning software development company, EISI. My job was to make the printout reports look pretty. Very little actual programming was done, as this was more of a Microsoft Word formatting position.

Work Environment:
The office is a nicely laid out open concept. I much prefer this approach than to a cubicle or closed door feel. I get a sense of community as opposed to solitude. I find that my satisfaction and productivity gain from this type of layout. Which of course means I’m happier and more interested in performing well.
We use mac laptops for our daily operations, which I must say, I’ve grown to love. All through university Unix/Linux and Windows were the only platforms I’d worked with, but now that I’ve experienced a finely tuned Mac OS I don’ think i can go back. Simple tasks such as opening a particular file or program are made easy with Mac friendly plugins like quicksilver. The operating system doesn’t bog down my application processes, and so my machine feels smooth and effortlessly working at all times.
- as a junior/newbie java developer i’ve been thrown into projects that I believe were placed on my lap to help train me. I started working on an internal project that was just coming into form, created to help ease the burden of repetitive code hackery with Jsps, controllers and database repository magic
- the next project that i moved to involved learning velocity templates, parsing/persisting xml feeds, database setup, and a lot of debugging. Which is good, as I’ve learned a lot about JUnit tests and the eclipse debugger tool.

The Office View:
I take pleasure in the great view overlooking North Vancouver and the mountains to the North. There’s something about being able to focus one’s eyes at different things in the distance that make working on computers all day easier on the body. I glance to my right often to catch the street traffic on the corner of Water and Cambie. I spin my chair to the left to get the view of the bay. At night the lights from across the way are calming and elegant. A great view indeed.

Special Treatment:
This company has gone the extra mile to provide exciting group activities. And I love it. So far since I’ve started working here I’ve been taken rock climbing in Squamish, kayaking in the Indian Arm, and recently snowboarding in Whistler for our Christmas party. Other less intense events are our weekly yoga meeting, which I must admit is fun, and it’s been helping with my tight muscles, and injuries from playing hockey.
I’ve also taken advantage of the physical activity subsidy we get, and have saved $400 on hockey and gym memberships. There’s a great benefits package for massage / physiotherapy that I haven’t used as of yet, but the massages are calling my name.

The People:
There are definitely no two peas from the same pod at 2paths. Each one of the people I work with is completely different, or has quirks that make them appear different from the rest. It’s hard to explain really… See, many places where I’ve seen groups of people, the groups tend to think alike, and act alike. The only thing that half of us have in common, is we like video games. But that really comes with the territory of computers anyway.
Interesting music tastes, ranging from country and blues to strange Finish folk music to South American techno pop to my personal favorite: rock.
There are a few who try to rock climb as often as humanly possible. Others who like to vegetate in front of the TV. Two World of Warcraft fanatics. I play hockey in a recreational league. We have a few hikers and a couple of people have yachts. A couple dog owners who bring in their pets. So yeah, a pretty diverse group of people.

-Garrett