The problem is a conflict between configuration files existing in META-INF/services/
both in fop
jar file and xmlgraphics-commons
jar file.
If you're using maven and want to avoid exclusion that may sometimes cause troubles, you can use the maven shade plugin to build a jar and force the concatenation of configuration files in META-INF/services/
. A snippet like this one works for me:
<build>
<finalName>desired_jar_name</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.1.0</version>
<configuration>
<transformers>
<transformer
implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
<transformer
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>my.main.class</mainClass>
</transformer>
</transformers>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>