Details
-
Improvement
-
Resolution: Fixed
-
Major
-
17.10.0
-
None
-
Unknown
-
Description
The Extension Manager indexes the components an extension declares in the xwiki.extension.components Maven property. This is what lets the editor suggest installing the extension providing an unknown macro. Declaring a macro there is easy to forget: no module of commons, rendering or platform declares its macros today, and nothing reports it.
Proposal
Fail the build when the macros declared in xwiki.extension.components do not match the macros the module provides:
- Java macros (jar modules): a new Spoon check, MacroDeclarationProcessor, finds the non-abstract @Component classes implementing org.xwiki.rendering.macro.Macro and takes their hints from @Component(hints), @Named or default.
- Wiki macros (XAR modules): xar:verify collects the ids of the XWiki.WikiMacroClass objects.
Both report:
- a provided macro which is not declared, with the line to add (e.g. org.xwiki.rendering.macro.Macro/toc)
- a declared macro which is not provided anymore
- a macro declared with a generic role (e.g. org.xwiki.rendering.macro.Macro<?>/toc), which the extension index does not find
- a component whose type hierarchy cannot be resolved, since it is then impossible to know whether it is a macro
The xwiki.extension.components.check.skip Maven property disables both checks, e.g. for test modules whose macros are never installed through the Extension Manager.
Attachments
Issue Links
- relates to
-
XCOMMONS-2829 Add extension components metadata for all script services exposed
-
- Open
-