May 29, 2008

Change message for Badly formed Maven project in NetBeans

If we do something wrong in our pom.xml we see the following in our Projects view in NetBeans:

We can change this by editing the file fallback_pom.xm. We can find this file in our NetBeans settings directory (default this is ${HOME}/.netbeans/6.1) and then in the maven2 directory. The fallback_pom.xml is just a very simple POM and is used for any Maven project with errors. We can add for example a description with a little hint:

<project xmlns="" xmlns:xsi=""
    <name>&lt;Badly formed Maven project&gt;</name>
    <description>Check the syntax of the pom.xml file or look in the /var/log/messages file in your settings directory.</description>
Now when we have an error in our POM we see the description with our text: