Skip to content
This repository was archived by the owner on Mar 11, 2025. It is now read-only.

Conversation

@anthony-beurive
Copy link

An attempt to fix MPDF-8.

It makes maven-pdf-plugin look a bit more like maven-site-plugin in that it adds a pdf:stage goal which aggregates the intermediate outputs of pdf:pdf of each sub-module.

It is a working solution (at least in another project I work on) but nothing is perfect. TOC numbering seems wrong in final PDF (maybe not using a recent doxia with closed DOXIA-564; dependency issue on my part?).

I used JSON to serialize/deserialize the TOC of each sub-module but I can only start to guess it isn't standard maven way.

Comments are welcome.

@hboutemy
Copy link
Member

Hi Anthony,

Thanks for this great contribution: it works like a charm.
I'll send you a PR adding an IT.

But there is one serious issue before I can merge: org.json dependency can't be used, since its license is not free (a little addition to MIT license that cause many headache to many lawyers)
https://www.apache.org/legal/resolved.html#json

please replace this dependency with another: Json format is not an issue, just this library

A little enhancement for future work could also be to add a separator page for each module, since currently the swithc from one module to the next one is not really visible: but that one is not a blocker

thanks again for your help: it is greatly appreciated

@anthony-beurive
Copy link
Author

Hi Hervé,

Thanks for the comment and the PR. I will merge it right away.
I will then be looking for an alternative to org.json in the coming days.

@anthony-beurive
Copy link
Author

I switched to JSONUtil. Its license is Apache's 2004. Does it fit?

@hboutemy
Copy link
Member

everything should be fine now, I'll review in a few days
thank you Anthony

@hboutemy
Copy link
Member

ok, I worked quite a lot on this PR: I'll send you the result as a PR to your branch
I renamed the goal to pdf:aggregate, since it's an aggregator job (really not like stage), then separated aggregate output from root-module only.
You'll see one impact: now, the root module pdf:aggregate goal does not run reports, but aggregates reports run during pdf:pdf, which is IMHO more consistent
this leads to one big issue: I discover that only Doxia source-generated content is rendered (ie xdoc generated by reports), but not the content that is generated without this xdoc intermediary format
I'll open a separate issue, since it seems our MPDF-48 fix was only partial.
But the consequence on aggregated content is that I fear that there is no code to aggregate such content, isn't it?

@hboutemy
Copy link
Member

forget about my last explanations about MPDF-48: I'm completely wrong...

@hboutemy
Copy link
Member

if you agree with the changes, please squash the commits and update the PR: this time, I think it'll be ok to merge

* fixed typo

* formatting cleanup

* [MPDF-88] upgraded Doxia Sitetools to 1.8.1

* [MNGSITE-328] use sha1 checksum instead of md5

* [MPDF-8] Create one PDF from a multi module project

* fixed issues reported by Checkstyle

* [MPDF-8] added IT

* [MPDF-8] Switch to JSONUtil library (Apache license)

* [MPDF-8] renamed stage to aggregate since aggregating goal

* [MPDF-8] extracted TOC save/load code to TocFileHelper

* [MPDF-8] separated aggregate from root module outputs
@anthony-beurive
Copy link
Author

Thanks, Hervé! Commits squashed.

@hboutemy
Copy link
Member

hboutemy commented Jun 3, 2018

merged in b03faf6
thank you

@hboutemy hboutemy closed this Jun 3, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants