Migrating your project to Maven 2 – Part II

06 Mar, 2006
Xebia Background Header Wave

The last thing I did was running the test classes successfully. Now let’s put in all the reports. We currently have the following reports in our maven build are:

  1. Jira
  2. Javadoc
  3. JavaNCSS
  4. Checkstyle
  5. PMD
  6. FindBugs
  7. JDepend
  8. Simian
  9. JUnit
  10. Clover
  11. Dashboard

First lets start by running mvn site out of the box (one of my favorite test cases ;-)), this should create the default reports according to the maven documentation ( Here we go: mvn site….

[INFO] Generate "Continuous Integration" report.
[ERROR] VM #displayTree: error : too few arguments to macro. Wanted 2 got 0
[ERROR] VM #menuItem: error : too few arguments to macro. Wanted 1 got 0
[INFO] Generate "Dependencies" report.
[INFO] null
[INFO] Trace
at org.apache.maven.artifact.resolver.DefaultArtifactResolver
at org.apache.maven.artifact.resolver.DefaultArtifactResolver
at org.apache.maven.project.DefaultMavenProjectBuilder
at org.apache.maven.project.DefaultMavenProjectBuilder

Nope, not out of the box… It seems that maven site does not work, although it’s mentioned on the maven website that it should work without any adjustments.
I googled about and found the following suggested solutions: Using a snapshot version of the project-info-reports plugin as mentioned on the following link:–t1095846.html, but that caused another error.
Maven said something about a default skin that did not exist. I also found a link that possibly would fix this,—where-do-i-get-it–t1180771.html, but that led me to the same NullPointer mentioned above.
I just wanted to conclude that site doesnot work yet in maven 2, but then I read this article on javaworld: were they managed to get it work. I tried the example attached to the article and that one did work indeed. The main difference between the two pom’s are the relative huge amount of dependencies that I have in my pom. That’s exactly the report is throwing the NullPointer according to the stacktrace. I will try to find out whats going on, and which depedency causes this NullPointer later. (But even if it is a broken dependency or whatsoever I would not expect the NullPointer…)
Let’s now focus on the individual reports that I want to use in Maven 2 and see if they are available yet

Report NameDoes it work in Maven 2?
JiraNot found
JUnitOK, its called surefire now.
CloverNOT OK, could not get it to work.
DashboardNot found

I could not download any of the sandbox plugins, I followed the instructions on, but no luck. Maven just could not download the plugins for some reason.
A lot of the reports we use now are still in sandboxes, so it’s not possible to migrate yet for us. Also I still need to investigate why maven site is throwing me the NullPointer before I can use the site generation. Untill this gets fixed or I get it working we are still stuck with maven 1.x.
(I used jdk 1.5.6_06 and maven 2.0.2 for this test)


Get in touch with us to learn more about the subject and related solutions

Explore related posts