• Home
  • RSS Feed
  • Log in


Migrating your project to Maven 2 – Part II
Posted by Lars Vonk late at night: March 6th, 2006

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 (http://maven.apache.org/plugins/maven-site-plugin/howto.html). 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]
[ERROR] FATAL ERROR
[INFO]
[INFO] null
[INFO]
[INFO] Trace
java.lang.NullPointerException
at org.apache.maven.artifact.resolver.DefaultArtifactResolver
.resolve(DefaultArtifactResolver.java:82)
at org.apache.maven.artifact.resolver.DefaultArtifactResolver
.resolve(DefaultArtifactResolver.java:63)
at org.apache.maven.project.DefaultMavenProjectBuilder
.findModelFromRepository(DefaultMavenProjectBuilder.java:386)
at org.apache.maven.project.DefaultMavenProjectBuilder
.buildFromRepository(DefaultMavenProjectBuilder.java:351)
at org.apache.maven.report.projectinfo
.DependenciesReport
DependenciesRenderer
.getMavenProjectFromRepository(DependenciesReport.java:362)
at org.apache.maven.report.projectinfo
.DependenciesReport
DependenciesRenderer
.renderBody(DependenciesReport.java:242)

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: http://www.nabble.com/-m2-Is-a-new-version-of-the-site-plugin-coming–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, http://www.nabble.com/default-skin—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: http://www.javaworld.com/javaworld/jw-02-2006/jw-0227-maven.html 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 Name Does it work in Maven 2?
Jira Not found
Javadoc OK
JavaNCSS Sandbox
Checkstyle OK
PMD OK
FindBugs Sandbox
JDepend Sandbox
Simian Sandbox
JUnit OK, its called surefire now.
Clover NOT OK, could not get it to work.
Dashboard Not found

I could not download any of the sandbox plugins, I followed the instructions on http://mojo.codehaus.org/using-sandbox-plugins.html, 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)

Share

Tags: Maven
Filed under General, Java | 6 Comments »



6 Responses to “Migrating your project to Maven 2 – Part II”



    Anonymous Says:
    Posted at: March 7, 2006 at 3:30 pm

    Good read! To bad you got stuck so quickly in the second part.
    Do you think we should maven2 for our projects? We can build them with maven2, probably easier than in maven1 (is it?), but I think reporting is a very important feature of maven. It might be quite some time before we can really use maven2 for a project then.
    It’s probably similar to Java 5.0. It’s been available quite some time now, but since none of the Application Servers support it, it’s hardly useable in any project we do.

    Reply


    Maarten Winkels Says:
    Posted at: March 7, 2006 at 3:31 pm

    this was me ^

    Reply


    Lars Vonk Says:
    Posted at: March 8, 2006 at 10:52 pm

    I would not choose maven 2 yet. Main reason is the missing reporting feature.I would still choose maven 1.x for projects (or maybe look at something else).
    BTW There are some appserver supporting java 5, like weblogic 9 (you probably missed the last techrally ;-) ).

    Reply


    Ravan Naidoo Says:
    Posted at: March 15, 2006 at 6:26 pm

    I’m currently using jdk 1.5.6_06 and maven 2.0.2.

    The maven 2 reports are really not up to scratch, but with a little tweaking it is possible to get them to work. The reports generated were the default reports and I have not tried to customize them.

    For the sandbox reports, I usually just download the source and build/install it locally. I’ve successfully done this for Cobertura (Test coverage) and Findbugs.

    For JavaNCSS, I had to add the jaxen.jar dependency to the pom before getting it to install. However when run, JavaNCSS didnot seem to like my java 5.0 generics and enums. Kept on getting ParserExceptions.

    JDepend has graduated from the sandbox, and this report worked out of the box.

    From what I’ve seen in the forums and in maven’s jira, the developers agree that maven 2.0.2 site is not very stable. They promise that site would be alot more stable in 2.0.3 release. But I have not idea when that comes out.

    Reply


    Jeroen van Erp Says:
    Posted at: April 3, 2006 at 11:27 am

    Well, maven 2.0.3 has been released. Let’s see how (and whether) it runs.

    Reply


    Jennifer Says:
    Posted at: March 15, 2007 at 6:58 pm

    After long strenuous hours of working on Maven2, I figured out what the “null pointer accpetion” was (as I was getting it a lot too). It means you are trying to download a plugin meant for Maven1. Also, it seems a lot have changed names (as you mentioned above about junit now being surefire) and many are still not yet converted. This is a good post though, I read a few things it took me a bit to figure out, and I wish I had happened on this site before!

    Reply


Leave a Reply

Click here to cancel reply.


Xebia Sites

  • Xebia Corporate
  • Xebia France
  • Xebia India
  • Xebia Sweden

Categories

  • Java (311)
  • Agile (181)
  • General (136)
  • Scrum (67)
  • Architecture (64)
  • Testing (59)
  • Performance (46)
  • Middleware (56)
    • Deployment (38)
  • Xebia Labs (39)
  • SOA (31)
  • Podcast (31)
  • Project Management (28)
  • Tools (26)
  • Uncategorized (20)
  • lean architecture (20)
  • Quality Assurance (17)
  • Articles (13)
  • Requirements Management (13)
  • Virtualization (19)

Tag Cloud

    TDD ACT lean architectuur Eclipse SOA Lean Javascript Grails Hibernate Java Scrum Ajax Scala Frameworks Spring JPA lean architecture Maven JPA implementation patterns Oracle Flex Groovy Concurrency Control agile architectuur Moving to India Architecture Xebia Agile product owner XML

Archives

  • February 2012
  • January 2012
  • December 2011
  • November 2011
  • October 2011
  • September 2011
  • August 2011
  • July 2011
  • June 2011
  • May 2011
  • April 2011
  • March 2011
Avatars by Sterling Adventures