#922 Maven pom.xml for JFreechart seems invalid



The maven pom.xml file published for jfreechart on the central maven repositrory doesn't look correct. The junit dependency should be marked with the test scope or be made optional.

This was wrong in 1.0.0-RC1 but was fixed in 1.0.1 (http://repo2.maven.org/maven2/jfree/jfreechart/1.0.1/jfreechart-1.0.1.pom) and it's now wrong again in 1.0.11: http://repo2.maven.org/maven2/jfree/jfreechart/1.0.11/jfreechart-1.0.11.pom

You also need to make gnujaxp optional I believe.

optional dependency: http://maven.apache.org/guides/introduction/introduction-to-optional-and-excludes-dependencies.html

maven dependency mechanism: http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html

I can help you but I'd need to know if the junit and gnujaxp deps are for tests only or if they're supposed to be there at runtime. If they're needed at runtime then are they required for the main features of jfreechart or not. If not they should be marked optional, ie it's the user who will add the dependency if he needs a special feature.

The problem is that majority of us have to manually exclude junit since otherwise it'll find its way transitively in our distributions for our projects using jfreechart.

Thanks for a great tool!


  • David Gilbert

    David Gilbert - 2009-03-25
    • assigned_to: nobody --> mungady
  • David Gilbert

    David Gilbert - 2009-03-25

    Hi Vincent,

    Thanks for the offer to help. I don't have a need for Maven, so I have to rely on others to maintain the pom.xml file and upload it to an appropriate repository.

    You'll find the latest version of the file that's used to generate the pom.xml file here:


    You'll see that Thomas Morgner (taqua) has already fixed the gnujaxp.jar dependency - we only need this jar file when running on JRE 1.3.1 (and even then only if someone wants to use the XML dataset reader classes). With JRE 1.4 and later, the required dependencies are built into the JDK. So hopefully now it is fixed, with the maven file showing a dependency on the xml-apis only.

    JUnit is only required for building and running the JFreeChart test cases, so of course that should be optional. If you could submit a patch for that, I'll commit it.

    The source repository for JFreeChart 1.0.x is in Subversion in the directory "jfreechart-1.0.x-branch". It looks as though the maven file is pointing people to the old CVS repository, which is wrong.

    Best regards,

    Dave Gilbert
    JFreeChart Project Leader

  • Martin Höller

    Martin Höller - 2011-10-13
    • assigned_to: mungady --> matinh
    • status: open --> closed-fixed
  • Martin Höller

    Martin Höller - 2011-10-13

    A valid pom.xml was committed in r2317.


Log in to post a comment.