Skip to content

Different behaviour for Fop Custom Resource Resolver in FOP 2.6 and 2.7+ [Proof of concept]

License

Notifications You must be signed in to change notification settings

fugerit79/fop-custom-resource-resolver-poc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Different behaviour for Fop Custom Resource Resolver in FOP 2.6 and 2.7+ [Proof of concept]

Abstract

For a library project I've been working, I designed a custom ResourceResolver to load fonts from the class loader instead than from the file system (the default behaviour of FOP).
This library was originally developed linking Apache FOP 2.6.
Recently I wanted to upgrade to Apache FOP 2.7 or 2.8, but when linking the new version of FOP, it seems the custom ResourceResolver is ignored.
This project provide a simple Proof of concept of this different behaviour.
The purpose is to open a bug on Apche FOP JIRA bug track and attach this POC as sample code.

Quickstart

  • mvn clean install -P fop26 [Test OK]
  • mvn clean install -P fop27 [Test Failed]
  • mvn clean install -P fop28 [Test Failed]
    The link to Apache FOP is achivied using a property fop-version overriden in thre different profiles :
  • fop26 -> version 2.6
  • fop27 -> version 2.7
  • fop28 -> version 2.8
    As you can see in the pom.xml file

The project structure

This project consists of basically of :

Test done

This porject had been tested with the same behaviour with :

  • JDK 1.8.0_333 and JDK 11.0.16
  • Apache Maven 3.8.6

Some sample build logs are provided :

  1. mvn clean install -P fop26 >> sample_build_log/build_log_profile_fop26_jdk8_win.txt 2>&1
  2. mvn clean install -P fop27 >> sample_build_log/build_log_profile_fop27_jdk8_win.txt 2>&1
  3. mvn clean install -P fop28 >> sample_build_log/build_log_profile_fop28_jdk8_win.txt 2>&1
  4. mvn clean install -X -P fop26 >> sample_build_log/build_log_profile_fop26_jdk8_win_debug.txt 2>&1
  5. mvn clean install -X -P fop27 >> sample_build_log/build_log_profile_fop27_jdk8_win_debug.txt 2>&1
  6. mvn clean install -X -P fop28 >> sample_build_log/build_log_profile_fop28_jdk8_win_debug.txt 2>&1
  7. mvn clean install -P fop26 >> sample_build_log/build_log_profile_fop26_jdk11_win.txt 2>&1
  8. mvn clean install -P fop27 >> sample_build_log/build_log_profile_fop27_jdk11_win.txt 2>&1
  9. mvn clean install -P fop28 >> sample_build_log/build_log_profile_fop28_jdk11_win.txt 2>&1
  10. mvn clean install -X -P fop26 >> sample_build_log/build_log_profile_fop26_jdk11_win_debug.txt 2>&1
  11. mvn clean install -X -P fop27 >> sample_build_log/build_log_profile_fop27_jdk11_win_debug.txt 2>&1
  12. mvn clean install -X -P fop28 >> sample_build_log/build_log_profile_fop28_jdk11_win_debug.txt 2>&1
  13. mvn clean install -P fop26 >> sample_build_log/build_log_profile_fop26_jdk8_linux.txt 2>&1
  14. mvn clean install -P fop27 >> sample_build_log/build_log_profile_fop27_jdk8_linux.txt 2>&1
  15. mvn clean install -P fop28 >> sample_build_log/build_log_profile_fop28_jdk8_linux.txt 2>&1
  16. mvn clean install -X -P fop26 >> sample_build_log/build_log_profile_fop26_jdk8_linux_debug.txt 2>&1
  17. mvn clean install -X -P fop27 >> sample_build_log/build_log_profile_fop27_jdk8_linux_debug.txt 2>&1
  18. mvn clean install -X -P fop28 >> sample_build_log/build_log_profile_fop28_jdk8_linux_debug.txt 2>&1
  19. mvn clean install -P fop26 >> sample_build_log/build_log_profile_fop26_jdk11_linux.txt 2>&1
  20. mvn clean install -P fop27 >> sample_build_log/build_log_profile_fop27_jdk11_linux.txt 2>&1
  21. mvn clean install -P fop28 >> sample_build_log/build_log_profile_fop28_jdk11_linux.txt 2>&1
  22. mvn clean install -X -P fop26 >> sample_build_log/build_log_profile_fop26_jdk11_linux_debug.txt 2>&1
  23. mvn clean install -X -P fop27 >> sample_build_log/build_log_profile_fop27_jdk11_linux_debug.txt 2>&1
  24. mvn clean install -X -P fop28 >> sample_build_log/build_log_profile_fop28_jdk11_linux_debug.txt 2>&1

As can be noted, in the build linked to Apache FOP 2.6 is possible to read the log of the custom ResourceResolver :

2022-11-20 18:29:15.358 [main] INFO  org.fugerit.java.poc.fop.custom.resource.resolver.ClassLoaderResourceResolver - TestClassLoaderResourceResolver.getResource() -> file:/C:/workspace/git/fop-custom-resource-resolver-poc/./target/classes/font/TitilliumWeb-Bold.ttf
2022-11-20 18:29:15.477 [main] INFO  org.fugerit.java.poc.fop.custom.resource.resolver.ClassLoaderResourceResolver - TestClassLoaderResourceResolver.getResource() -> file:/C:/workspace/git/fop-custom-resource-resolver-poc/./target/classes/font/TitilliumWeb-BoldItalic.ttf
2022-11-20 18:29:15.492 [main] INFO  org.fugerit.java.poc.fop.custom.resource.resolver.ClassLoaderResourceResolver - TestClassLoaderResourceResolver.getResource() -> file:/C:/workspace/git/fop-custom-resource-resolver-poc/./target/classes/font/TitilliumWeb-Italic.ttf
2022-11-20 18:29:15.503 [main] INFO  org.fugerit.java.poc.fop.custom.resource.resolver.ClassLoaderResourceResolver - TestClassLoaderResourceResolver.getResource() -> file:/C:/workspace/git/fop-custom-resource-resolver-poc/./target/classes/font/TitilliumWeb-Regular.ttf
2022-11-20 18:29:16.512 [main] INFO  org.fugerit.java.poc.fop.custom.resource.resolver.ClassLoaderResourceResolver - TestClassLoaderResourceResolver.getResource() -> classpath://font/TitilliumWeb-Regular.ttf

The same lines are not present when using the profiles linking to Apache FOP 2.7 and 2.8.

PS: the original library project where this BUG was found is Fugerit Venus.

About

Different behaviour for Fop Custom Resource Resolver in FOP 2.6 and 2.7+ [Proof of concept]

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages