Apache Maven Training in Vancouver – 1 week left to register

ApacheCon is in Vancouver this year, and now just 1 month away (Nov 7-11). There is still one week left to register for the training sessions, and to qualify for the early bird rate on the conference.

As in previous years, I’ll be offering an up-to-date version of the training course, Apache Maven: Effective Implementation:

This training course is designed to go beyond your current assumptions about Apache Maven and learn how to use it most effectively to manage the build and development process. Whether you are a novice aiming to start on the right foot, or a regular user looking to get more out of Maven and avoid common frustrations, this course will give you the skills you need to apply to your own projects. By working through a series of short exercises applied to a complete sample application, you will learn how to apply common patterns in Maven builds to achieve the desired outcome, while learning best practices and common pitfalls along the way. Topics include installation, Maven fundamentals, working efficiently with multi-module projects, simplifying the POM, the best general purpose plugins that you should know about, integration and functional testing, when (and when not) to use Maven sites and reporting, the role of profiles, snapshots and dependency management, repository management, and performing releases. The content is updated for the latest improvements in Maven 2.2 and Maven 3, and will cater to your preference of development environment. Time is reserved for sharing specific situations that attendees have encountered in existing projects.

The course runs for a full day on Tuesday, 8 November. If you’re planning to attend the training or the conference, you can connect to me on the conference website.

Obligatory OS X Lion Installation Post

A couple of years ago, I wrote up my experiences installing Snow Leopard on my MacBook Pro. With Lion out today, I’m doing the same (either as notes to self, or to help out other poor souls).

This time around I have two machines to install, so the rarely used MacBook is getting updated now, with the iMac on hold for a while so I don’t disrupt work. I’ll be well prepared for that one with both a Time Machine backup and a clone by Carbon Copy Cloner to a different portable drive!

Getting It

In my previous post, you’ll see I had some hassle getting a functional install disc for Snow Leopard. In that light, digital distribution was a welcome change – particularly being able to start downloading it in the middle of the night here as soon as it was out, and having it ready when I woke up. There were a few false starts with the App Store overloaded initially, but once it got purchased the download was fast.

You can check download progress in the “Purchases” tab – though since the store was timing out I found it easier to look in ~/Library/Application Support/AppStore/APPID. Note that this changes after the upgrade to Lion – instead being in a temporary directory (for me, it was $TMPDIR/../C/com.apple.appstore/APPID)

Once it was downloaded, I made sure to copy the install application to a thumb drive, so that I can install it on the desktop later without another hefty download. You’ll want to grab that before you actually install, as it appears to be gone afterwards. While I haven’t tried it yet, there’s plenty of instructions out there for installing from physical media – such as this one (though this isn’t necessary, as you can just run the install app again on the other Snow Leopard machine).

The Install

The install process is very similar to that of Snow Leopard, though I had no problems such as I did that time. It spent its 45 minutes installing, rebooted, and came back to the new login screen.

The Victims

Here’s what I’ve found didn’t work out of the box:

  • X-Code command line tools
  • Homebrew (by virtue of the above)
  • Java
  • Java applets
  • AUSkey (required Java applets)
  • TruePreview (Mail extension to avoid marking as read immediately, will have to live without it for now)
  • Skype had some UI glitches related to scrolling (upgrading to 5.2 fixed it)
  • The Omnifocus mail integration (re-installed from OmniFocus preferences again)
  • The Basics Growl style (text always comes up black, switched to the “Mono” theme from the same site instead)

Parallels went out of there way to email today and say that my old copy of Parallels Desktop 4 won’t work in Lion, though I’m yet to try it. VMWare only refers to version 3.1.3 being fine, but I still seem to be able to run Fusion 2 just fine as a host – though it’s falling behind on guest support. I should be able to keep using that. I’m not inclined to pay for an upgrade, so it might be time to try VirtualBox again.

Some other things that I had previously been using (like MailTags and Mail Act-on) didn’t survive the Snow Leopard upgrade, so that made things simpler. One or two (like Dovecot) I won’t find out until I try again on the iMac.

Xcode Command Line Tools

This has been a problem for a while – each new release you could get a smaller download from Software Update, or the multi-gigabyte one from the Developer Center. Putting the smaller download on multiple machines meant intercepting the download to copy it before the update got erased, though – and it felt like it wouldn’t last forever.

That seems to be the case now – with Xcode 3 not working on Lion, I bit the bullet and got Xcode 4.1 from the App Store. It’s a large download, but the good news is that after “installing”, it just puts an “Install Xcode” application in place, like Lion itself. You can then copy that around to install elsewhere (though I’m yet to try – we’ll see if the App Store still recognises it).

This installs Xcode as well as the command line tools – I’m not sure at this point if there is a leaner option.

The installer has some oddities though. First, it requires that you close iTunes even if it isn’t running – to correct that I had to kill iTunesHelper from the command line. Beyond that, it seems to get stuck at the very end of the progress bar and never ends. I closed the window and everything seems installed, but it hasn’t removed the installer application.

Homebrew

After updating Xcode, brew doctor seemed happy again, so nothing more to do there.

Java

The concern about Java not being installed on Lion seemed to have died down, and it was pretty much a non-event in this case. After installation, I immediately went to a terminal and typed “java”, at which point it prompted to download it for me, and worked just fine after that.

Java Applets

It was a bit unclear at first why, but pages with applets weren’t working in either Safari or Chrome. I found that I had to go to the “Java Preferences” panel and check the box that allows applets, as they had been disabled by default.

Bugs

I’m sure I’ll find several issues as I go along, but for now it has been fairly limited.

  • Chrome has the button to go fullscreen, but not the one to go back and permanent scrollbars (this has now been written about)
  • Colloquy 2.3 has the same scrollbar problem, and displays all times in UTC. The 2.4 release from http://colloquy.info/downloads/ seems to resolve them but hasn’t been announced yet (but must be close!)
  • My original desktop background disappeared on the iMac (fine on the Macbook), replaced by a starfield, and today replaced by a blank blue background. This seems to be a result of setting it from iPhoto ’09 – exporting and setting by right clicking on the JPEG worked

The Verdict

My initial impression of Lion seems to fit with the majority of the observers – a worthwhile upgrade for the price. I haven’t used it enough to really say yet. The feature I’m most looking forward to seeing in practice is the document versioning and application state restoration, but it’s not that useful when it’s only in TextEdit right now.

The UI changes make sense to me so far, though I had to forcefully hide the scrollbars for the reverse swiping to make sense again (the default for the old Macbook trackpad was always on). Honestly the UI changes don’t really excite me a lot either – it overall doesn’t feel too different to Snow Leopard.

The new 3-pane interface and threaded view in Mail is welcome, though otherwise there doesn’t seem to be too much different in this release. I might try iChat over Adium for a while again to compare, since it now supports all those old Yahoo messenger buddies I have.

Aside from that, I’m not going to bother reviewing the features, as plenty have done that so far (the most detailed as always being John Siracusa at Ars Technica).

Hope this helps someone!

Apache Archiva 1.3.3 released: performance improvements!

If you’re using Archiva for your repository management needs, you should definitely upgrade to the latest release. Download it now!

The 1.3.x series has focused on the biggest offenders in memory usage and performance problems, and Archiva 1.3.3 brings the biggest improvements yet:

  • Full scans should take about 1/3rd of the time and consume far less memory
  • Removed one-off memory hits at the end of a scan
  • File descriptor use during concurrent deployments are better managed

In addition, a new system status page is available for assessing the cause of potential performance issues at runtime, giving better insight into how to tune memory or scanning settings appropriately.

This work is in advance of the upcoming Archiva 1.4 release which has revived the internals more significantly, with further performance improvements and a series of new features.

It’s also worth noting that we dropped support for Archiva 1.1.x and Archiva 1.2.x in November, so there’s no reason left to remain on older versions.

I’d like to thank YourKit, who provided a free license for their profiler, which was of great assistance in tracking down these issues. I’ve used it on occasion for a number of years, and it is one of the easiest tools to use that I’ve ever encountered.

The full set of issues resolved follow:

  • [MRM-1097] – Error 500 "too many open files"
  • [MRM-1369] – Editing user roles in archiva clobbers continuum redback roles
  • [MRM-1396] – Purge task problem : Not enough parts to the path
  • [MRM-1421] – Archiva repository purge incorrectly purges based on file timestamps even when the snapshot timestamp is known
  • [MRM-1443] – repository statistics collection can cause server to hang
  • [MRM-1416] – upgrade to Redback 1.2.5
  • [MRM-1439] – improve indexing performance
  • [MRM-1440] – system status page
  • [MRM-1441] – monitor repository scanning progress
  • [MRM-1442] – track time spent in each consumer during a scan, to help diagnose poor scanning performance
  • [MRM-1445] – disable referrer check by default

BarCamp Apache Sydney is this Saturday!

Great news – we seem to be getting quite a few last minute registrations for the BarCamp. There’s still time to sign up, or invite a colleague, if you’re coming along!

Here’s the details in a nutshell…

BarCamp

Date: Saturday, 11th December
Time: Registration is at 9:30am, for a 10am start.
Venue: The Darlington Centre, University of Sydney, at 174 City Road, Darlington
Cost: free
Food: coffee, snacks and lunch provided by the sponsors
Other: free wifi available
Sign up and details: http://barcamp.org/BarCampApacheSydney

Pre-BarCamp Dinner and Drinks

Date: Friday, 10th December
Time: Meeting at 7:30pm, reservation is for 8:30pm
Venue: Sumalee Thai, in The Bank Hotel, Newtown
Cost: $30pp for a variety of dishes, includes a vegetarian option
Sign up: indicate it on the wiki or the barcamp-sydney Google group

See you there!

Using a GPG agent for signing Maven releases on Mac OS X

Using the Maven GPG Plugin makes it easy to sign a large number of artifacts when performing a release with Maven.

However, one of the annoying parts is that interactive password entry is not particularly easy, and you often have to put it on the command line or into your settings file in plaintext, which is not very comfortable. The better alternative is to use gpg-agent, and if you’re not using GPG 2.0 this needs to be configured in the POM:

  <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-gpg-plugin</artifactId>
    <version>1.1</version>
    <configuration>
      <useAgent>true</useAgent>
    </configuration>
  </plugin>

GPG will fallback to the same password entry if it is not running or if it is provided via the property, so there’s no particular downside to enabling the option.

The problem on Mac is that the situation with GPG is a little confusing. There seem to be several different projects floating around to provide it.

I’m a big fan of Homebrew, and previously I’d been using that to install GnuPG and gpg-agent. It worked quite well, but the password entry required curses, and also didn’t work in an interactive session – so you’d need to make sure to have entered it manually before starting a release. If it failed mid-release, you’d need to restart the agent. None of this was Homebrew’s fault – I just hadn’t been able to find a native pinentry app for the Mac that stood alone and didn’t crash on use.

After fiddling with it for a while, I decided to try one of the native Mac GPG installers again. This is where it got confusing, since there are several efforts floating around. Others may work, but the one I had success with is the revived GPGMail project. After uninstalling all the packages using Homebrew, I installed GPGTools from the download page. Since this includes a native pinentry application, and pre-configures gpg and the agent to run once on login, it worked much better.

The only catch if you’re trying this is that you need to logout, or in your shell run this until you have:

open /usr/local/libexec/start-gpg-agent.app/
. ~/.gpg-agent-info
export GPG_AGENT_INFO

You can test that it is working outside of Maven by running: gpg -ab (ending with Ctrl-D),