You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-dev@xmlgraphics.apache.org by "Skip de Groot (Jira)" <ji...@apache.org> on 2022/08/17 12:17:00 UTC

[jira] [Commented] (FOP-3088) Jar packaging duplicates classes on classpath

    [ https://issues.apache.org/jira/browse/FOP-3088?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17580759#comment-17580759 ] 

Skip de Groot commented on FOP-3088:
------------------------------------

I'm not sure that is the quick fix you are looking for.

Now you are missing certain classes, I haven't checked everything but `org.apache.fop.tools.EventProducerCollector` is not packaged in the main fop jar and only in fop-events. And when you import this sub jar manually to get everything, you still have the problem of class duplication or you need to just drop the fop.jar and only import fop-core, fop-events and fop-util. Certain resources will be missing as well I think since they aren't copied over either.

And will defining these as optional still allow for imports of any transitive dependencies the classes need? I think this will not include transitive dependencies from fop-core like batik or other. Making the imported classes broken since the dependencies they use are not actually imported since everything is marked as optional.

 

Am i seeing this wrong? Am I importing the wrong package or something?

> Jar packaging duplicates classes on classpath
> ---------------------------------------------
>
>                 Key: FOP-3088
>                 URL: https://issues.apache.org/jira/browse/FOP-3088
>             Project: FOP
>          Issue Type: Bug
>            Reporter: Skip de Groot
>            Assignee: Simon Steiner
>            Priority: Major
>
> I have a gradle project where we import apache fop with the following:
> {code:java}
> implementation("org.apache.xmlgraphics:fop:2.6") {code}
> Which results in the following dependencies being loaded on the classpath (I have removed the sub dependencies for simplicity)
> {code:java}
> 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 {code}
> 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?



--
This message was sent by Atlassian Jira
(v8.20.10#820010)