Uploaded image for project: 'FOP'
  1. FOP
  2. FOP-3088

[PATCH] Jar packaging duplicates classes on classpath

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 2.9
    • None
    • None

    Description

      I have a gradle project where we import apache fop with the following:

      implementation("org.apache.xmlgraphics:fop:2.6") 

      Which results in the following dependencies being loaded on the classpath (I have removed the sub dependencies for simplicity)

      org.apache.xmlgraphics:fop -> 2.6
      +--- org.apache.xmlgraphics:fop-util:2.6
      +--- org.apache.xmlgraphics:fop-events:2.6
      \--- org.apache.xmlgraphics:fop-core:2.6 

      So far so good and everything works most of the time. I suspect any maven project would import in the same way.

      However, most classes are duplicated in fop-2.6.jar and their respective sub module. For instance, the org.apache.fop.apps.FOUserAgent class is packaged both in fop and fop-core.

      All classes from the fop-events module in org.apache.fop.events package are also duplicated, but not from the org.apache.fop.tools package from the fop-events module (For instance org.apache.fop.tools.EventProducerCollector), making this also inconsistent somehow.

      Luckily both implementations seem the same but it is bad practice to have duplicate classes on the classpath, and package sizes are also doubled.

       

      Depending on the implementation choice I would either expect a fatty jar with all the classes packaged which does not import anything or an somewhat empty root fop jar with all classes imported by the sub modules. As it stands now it seems to be a combination of both and not a completely consistant one either.

      Which one is the prefered solution of this project?

      Attachments

        1. 3088-patch.diff
          4 kB
          Dave Roxburgh

        Activity

          People

            ssteiner Simon Steiner
            skipdegroot Skip de Groot
            Votes:
            2 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: