Friday, May 29, 2009

JPackage Nonsense

I've never understood the purpose of the JPackage project. As a Java developer one would think I would be in their target audience, but it really doesn't solve any problems for me, and causes many inconveniences. The goal of the project is to package java projects up into nice little upgradable rpms, but I think the java and rpm worlds are really just incompatible. I use Fedora (currently version 10) for my main development environment and I've tried using the prepackaged version of things like eclipse, but it never seems to work as well as the downloadable version.

Just today I was having problems with an Ant build using ant version 1.6.5 (I currently have 3 different versions of Ant installed for testing). I'm getting errors with 1.6.5 that I haven't seen before about missing task definitions. So I run "ant -version" to make sure I'm pointing to the right installation and it returns version 1.7.1. That's weird! So I double check my path "which ant" and check "$ANT_HOME", both are pointing to ant 1.6.5. I end up tracking down that the ant startup script is looking for a file called "/etc/ant.conf" to use as a global configuration file. I don't remember editing this file, but I do remember past experiences with jpackage rpms that do weird stuff to my java applications. Sure enough this configuration came from an rpm and is now breaking my default ant installation.

So the only way to fix this is to either remove the file from "/etc/ant.conf" but the next yum update will probably just put it back and break things again. Or I can hand modify my ant 1.6.5 startup script to not check for this file (very ugly).

I decided to remove the ant rpm "yum remove ant". This fixed my ant installation, but I'll have to watch out for this in the future in case the ant rpm accidentally gets installed again.

Thursday, March 26, 2009

Jar Manifest Attribute Names

I probably should have known this before, but I discovered today that a "." character is invalid for a jar manifest attribute name. The attribute name is limited to:

{A-Z} | {a-z} | {0-9} | - | _

I tried using an attribute name of "java.version" in my jar manifest and the jar was created by the Maven build without any problem, but when the jar was used as a dependency of another project, then I got a warning about an invalid name.

The maven jar plugin and maybe assembly plugin should probably do some regex validation while creating the jar to at least give a warning. Otherwise maven will happily create a jar with invalid manifest and you may not discover this error until it starts causing some problems in other projects. I created a Jira Issue about this.

Wednesday, January 28, 2009

Restore a deleted file from subversion.

If you want to restore a deleted file from svn there are a few ways to do it, and some work better than others.

The subversion book gives the basic info for restoring a file using either merge or copy. However, the method used in the example for copy didn't work for me. So let's say you delete a file "Stuff.java" in revision 100. Then you would want to restore the file, using the previous revision, into the current working directory like this.

svn copy -r 99 http://svn.mycompany.org/repos/myproject/Stuff.java Stuff.java

My svn server didn't seem to handle the revision option correctly, and kept telling me that the file didn't exist. So an alternative syntax looks like this:

svn copy http://svn.mycompany.org/repos/myproject/Stuff.java@99 Stuff.java

This second syntax, which I didn't see mentioned in the svn book, worked like a charm for me.

If you don't know in which revision the file was deleted, you can use svn log in the directory to see a history of file changes.

After you copy the deleted file, you are not quite finished. You'll still have to commit your changes. So something like svn commit -m "Restore file Stuff.java" will finish the job.


Monday, January 12, 2009

RPM for Pidgin msn pecan

Apparently Microsoft changed something on the MSN Messenger servers today, and this was causing problems for many people using Pidgin. One workaround is to use the modified msn plugin from google. But I couldn't find any Fedora rpms for this. So I decided to make one.

The rpm for Fedora 10 is here.
And the source rpm is here.

Thursday, December 18, 2008

The fog

It was a beautiful foggy day today, so I decided to take a few pictures on the way to work.


Thursday, August 14, 2008

Recursively remove .svn directories

It seems I regularly need to remove all the .svn directories from a directory structure. It would be nice if this function to disconnect a directory structure was built into svn, but since it is not, I usually use this command from the root of the project directory structure:

rm -rf `find . -name .svn`

Thursday, June 5, 2008

You talk better than you fool

One of my favorite Simpson's quotes:

Bart: You're going down, Homer. I'm gonna fool you!
Homer: You talk better than you fool.
Bart: I'll fool you up real nice.
Homer: You couldn't fool your mother on the foolingest day of your life if you had an electrified fooling machine.