MvnIndex.org launched

Every good work of software starts by scratching a developer’s personal itch.

I have not written anything to the blog for quite a long time. The reason is simple. I did not have time. The main reason was not my job hunting as you would suspect but my hobby project MvnIndex. It is just another attempt to make Maven more user friendly.

I have written indexer of central repository, implemented small and simple on-line search engine and what is the most important, I wrote simple Eclipse plugin that helps me with writing POMs. Now I think it is stable enough to make it public. (By saying that it is stable enough I do not mean that it is stable:-).

I would appreciate some feedback. I’d like to know what do you think about it. Whether you think that it is useful and if so, what should be done in the next step. Do not hesitate and write it to my JIRA.

Be aware that it is just the very first version, there is some stuff that has to be done to make it completely production ready. Eclipse plugin lacks ability to use customer provided index files to be able to work with inhouse artifacts. Automatic update of data would be also nice. I am planning to implement it in the next iteration.

I am looking for a job

This entry is not about Java. It is personal. Currently I am looking for a new job and I think that blog could be a good way how to find some contacts. Of course that as Java programmer I have no problem to find a decent job. But I have two problematic conditions. First of all I’d like to see Agile development. I have read lot of books about it, I think that it is the only way how to do software. But I have never seen it. Secondly, I want to go abroad for few months. Preferably to London or Geneva. Since I have no contacts there, it is not so easy to find a job there.
So, if you know about someone who is looking for really good Java developer for an Agile project in London, could you send me an email (lukas{at}krecan.net) with contact please? My CV is available here.

ProcessBuilder and quotes

Recently, I have spent few happy hours chasing a bug in my code. It was connected to the ProcessBuilder class. This class was introduced to Java 5 in order to simplify calling of external processes.

I needed to run following rsync command, to synchronize some files from the server. It simply takes all *.txt files from all directories and ignores all other files.


rsync -vtlr --include="*.txt" --include="**/" --exclude="*" rsync.example.org::module ./mirror

With ProcessBuilder it is easy, you just have to write the following code.



    ProcessBuilder pb = new ProcessBuilder("rsync","-vtlr""--include=\"*.txt\"","--include=\"**/\"""--exclude=\"*\"""rsync.example.org::module""./mirror");
    pb.directory(directory);
    Process process = pb.start();
    int result = process.waitFor();

It works good, without any problem. But only on Windows. When I deployed the application on the Linux server, it synchronized all the files. It looked like that –exclude directive was simply ignored.

The weird thing was, that when I run the command from the shell it worked as it was supposed to run. The usual suspects were the quotes. Since the command worked, only some parameters were ignored, it was evident that the problem is subtle. I tried to replace double quotes with single quotes, put all parameters to one. I even tried to call the command using Runtime.exec(). It was just vain effort. (Runtime.exec() internally uses ProcessBuilder). The solution is simple. Just remove all the quotes from all parameters.



ProcessBuilder pb = new ProcessBuilder("rsync","-vtlr""--include=*.txt","--include=**/""--exclude=*""rsync.example.org::module""./mirror");
    pb.directory(directory);
    Process process = pb.start();
    int result = process.waitFor();

Like this, it works on both Linux and Windows.