Re: About Asciidoctor Maven integration: A custom lifecycle
Posted by
abelsromero on
Aug 12, 2019; 11:31am
URL: https://discuss.asciidoctor.org/About-Asciidoctor-Maven-integration-A-custom-lifecycle-tp7063p7068.html
I have to say I am a bit reluctant (but not 100% closed) to such approach for practical reasons, but it makes totally sense. I too have relied in profiles and try to adhere to mavens life-cycle, and is not always perfect and it feels "shoehorned". But that's a consequence of maven's core design philosophy.
A custom lifecycle requires much though to accommodate future scenarios and implies several decisions that can limit future options and imposes certain patterns. For example, should we publish in zip or jar? should we create a sources artifact also? should package resources separatedly with a maven classifier?
See the discussion:
https://github.com/asciidoctor/asciidoctor-maven-plugin/issues/321 to get some ideas.
The thing is when you go deep into this, you end-up modeling a whole building, reuse & distribution solutions. And if that's the case, and you just publish HTML, I'd highly recommend checking out Antora.
Said that, if we can add this as an extra options without changing current behavior we can explore it. But I'd recommend aligning with the default's maven lifecyle as much as possible. That way it's easier to understand for users and we can inject more steps in the build process without issues. One case for example where it makes sense is when integrating plugins that create temporal files, a "prepare-*" phase would make sense to move files to a staging area.
Note this requires to rebuild the plugin into several sub-plugins for each phase.