Deploy Maven Webstart Projects

Ryan Sonnek bio photo By Ryan Sonnek

I’ve continued to work on shard-cyclops this last week and just pushed out a new release that has a few updates including:

  • display the distance of the token path while moving around the grid

  • automate deployment of the project using the new codecrate webstart plugin

That’s right, the codecrate webstart maven plugin can now deploy your distribution as well as create the fancy JNLP file. By adding your maven repository ID and URL to your plugin configuration, you can now upload your JNLP and jar artifacts automatically as part of your maven build!

<plugin>
  <groupId>com.codecrate</groupId>
  <artifactId>webstart-maven-plugin</artifactId>
  <executions>
    <execution>
<id>deploy-webstart</id>
<phase>deploy</phase>
<goals>
  <goal>deploy-jnlp</goal>
 </goals>
    </execution>
  </executions>
  <configuration>
    <mainClass>com.mysite.MyApp</mainClass>

    <id>codecrate-ftp-repo</id>
    <url>ftp://www.codecrate.com/shard/shard-cyclops</url>
  </configuration>
</plugin>

The implementation was a bit too easy if you ask me. The maven-wagon library is intended to be an abstraction around file transfers so your plugin can transfer files across any protocal (ftp, scp, local, webdav, etc). I was right to be skeptical because it seems that the maven-wagon project is yet another red headed stepchild of the maven umbrella. When using an FTP repository, wagon only supports transferring individual files and not an entire directory. WTF? Supposedly, this is done because FTP is slow for transferring files one at a time, but who the hell cares? I’ve got all of my builds automated, so why would I care if it takes 10 seconds or 10 minutes to transfer files?

Oh well, I have a workaround place to transfer files one at a time to get around wagon’s inadequacy. Yet again maven has taken a great idea (abstraction of file deployment for different protocols) and dropped the ball. It’s obvious that maven suffers from NIH Syndrome (Not Invented Here) and is ignoring a lot of work other developers have done. Commons VFS has a similar mission as wagon and has been around much longer. Why not leverage what’s already out there?

Enough ranting. I’m psyched to have the new plugin out the door, and now updates to shard-cyclops should become a regular occurance. Next up, I need to create a new maven plugin that will generate a “pretty” html page with the appropriate magic javascript to detect the Java installation on client machines.