Pain thresholds

Every four weeks we cut a release of my current project. The release duty usually falls on my plate, although we have passed it around in the past so that everyone is familiar with it.

Last Thursday was release day for us. Unfortunately, it took the whole day to release the project. We’re using maven to manage our build, and while Maven has an excellent release tool, it seemed that the release was taking a long time to get done. After some investigation, it looked like each build was taking an inordinate amount of time on this step:

[INFO] Generating "Dependencies" report.

Releasing just our top-level project, ignoring the dependent projects that also had to be released, took four and a half hours. That’s at least four hours too long. It tripped some sort of pain threshold in me, and I was determined to speed up the deploy.

Running the maven site:site target on a project also generates the dependency report. And it does it without all the trivia involved around actually releasing the project, like bumping up the version numbers and checking stuff into subversion. So this morning I ran site:site on one of our subprojects and it take 30 minutes. Most of that time was spent on the dependencies report, whatever that is. And since our main project has ten subprojects, it’s easy to see how the release took over four hours.

Searching the web turned up references to the report plugin dependencyLocationsEnabled flag. I added this code to our base pom.xml:

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-project-info-reports-plugin</artifactId>
    <configuration>
        <dependencyLocationsEnabled>false</dependencyLocationsEnabled>
    </configuration>
</plugin>

And re-ran the site:site target. This time, it took just over a minute. Presumably, our releases will take a lot less time in the future.

The interesting thing for me is that it took a fair amount of inconvenience before I actually tried to solve the problem. The time it takes to release our project has been creeping up as we increase the number of subprojects, but since it only happens every four weeks it wasn’t high on my list of optimizations. Another interesting question: if we continued to pass around the duty of releasing the code, would this have been changed sooner? Or would it have not been changed at all, since no one person would have noticed the increasing time that the releases were taking?

It's only fair to share...
Share on FacebookGoogle+Tweet about this on TwitterShare on LinkedIn

Leave a Reply