views:

124

answers:

3

I've build a small AppeEngine application which displays a green or red screen according to an URL call (/pass or /fail). That page is refreshed every minute.

The idea is to use a spare computer to display that build status page and set a continuous integration tool (TeamCity in my case) which will call the /pass or /fail URL at the end of each maven 2 build.

So, how am I able to make maven 2 call an URL at the end of a build (/pass or /fail)?

I'm thinking about a Maven 2 plugin but is it possible for a plugin to be called at the end of the build (and get the build status)?

+1  A: 

The status monitor plugin from Hudson does exactly what you want. It can even monitor multiple jobs instead of just one.

kazanaki
Indeed, that's good to know. However, we're using TeamCity and won't change our CI tool any soon.
paulgreg
+1  A: 

You could use antrun from maven in the "install" phase to check for the presence or absence of a file and then execute httpclient (or the equivalent) based on that. Or you could write a wrapper that calls maven and then calls curl.

sal
Yes, thanks. By the way, I've found that the simple way to call an URL in Java seems to be `new URL('http://yoururl').openStream();`. Notice that I'm not looking for any kind of response.
paulgreg
A: 

I think another way is to build a custom notifier for TeamCity, like the Nabaztag Notifier.

Update: Ok, I just began a custom TeamCity notifier on google code : buildstatusnotifier. It's so simple to build... :)

Here's the main class, WebNotifier.

paulgreg