CoffMan Blog Victor Fariña Infante , info about my own projects and thoughts.

24Jul/040

Apache Maven to substitute ant ...

The new tool from Maven takes me a headeache and a few days of configuration and learning about it, but in the end i think its a valuable tool and will be simplify my java developments. You can view my new JDiary home generated enterely with maven at the same time that I generate the JNLP to distribute.

What is Maven: Maven is a Framework for ant. Its POM (project object model) based and with a couple of files you can build the application, generate test reports, and an entire site for the application.

Overview:

All round about one file : project.xml here we define the name of the application, the jars it depends on, where are the CVS, and more information. see sample at the end of the POST. The sencond important file is project.properties. It store information about plugins properties for maven (as JNLP, SSH deployment, etc ...) again i post my sample file at the end. The last file is maven.xml (rarely you must modify or create it) but on this case it store ant scripts we need (because maven does not do all ) and goals (on the ant style) to build the application with our own rules.

Sample of starting a new application:

First of all you must download maven Install it (its very simple) I recomend use eclipse as you IDE , there are a plugin to eclipse to build maven files. Then you must start using maven (put it on the PATH) with maven -g or maven genapp, well read the tutorial here Some Samples : With maven jar you complie the sources. With maven site:generate you generate the entire site to your application. With maven site:deploy maven will generate a site for your application with download sections, Overview, Documentation, Javadoc, tests , etc ... like on my project JDiary

Problems i found

There are still very little Documentation .

Very little documentation ...

Its hard to start ( but i recommend to spend 1 or 2 days on this tool)

Some options I put on my xml files are undocumented and i put them using the intuition (such as maven.jnlp.isapplication = true in JNLP plugin) On the other side YOU MUST INSTALL cvs to make a cvs -d:pserver:cvs@yourserver:/cvsroot login to initialize the .cvspass on Windows machines. Instead of that you can create a .cvspass on your HOME with a content like this : /1 :pserver:cvs@CVS_SERVER:2401/usr/local/cvsroot ENCRYPTEDPASSWORD the encrypted password is obtained with maven changelog:create-cvspass Errors associated with this issue: -> Didn 't find password for CVSROOT ':pserver:user@(protected):/repos '. -> org.netbeans.lib.cvsclient.connection.AuthenticationException: Wrong Password. and more ... only for the CHANGELOG plugin

Sample Files : Because the tedios labour of pasting XML code on my blog, you must use the CVS repository to see my files.

Filed under: Tecnología No Comments
16Jul/040

Howto Maintain a large number of sites centralized with Jabber.

network map Page of the project The problem I find at my work was the next :

The problem:

When you maintain and update a large number of unix (or windows) machines you must review if all machines are UP, and in case of failure you must do something (well it depends on admin ;) ), also you would like to review if all goes well before a weekend ( admins tends to me very vagues).

The solution:

The architecture of the application is simple: you must rely on a machine (the central server or backup server) here you install NAGIOS (http://www.nagios.org/download/), this is a program in C that monitors the health of each server. You must configure a lot of archives (it takes a half day or so but its nice) in which indicate what servers to monitor and wich service offers each server, the alerts, the methos of communication and so on ... Ths next step (when you install nagios and test it) is to install sendJabber ( only on CVS at the moment) configure it with a valid account on a jabber server and tell him the user/users to send alerts. The next is configure again Nagios to send alerts throw sendJabber its so simpe sa adding a line to misccommands.cfg , then you must restart Nagios and all is OK. Just sit in front your computer and if something fails you must receive an alert on your Jabber client (I recommend GAIM )

I will post a more extense howto on the next days.

TODO:

On future releases onf sendJabber you can intereact with NAGIOS server, send commands and receive status about servers. and more ...