Uploaded image for project: 'XWiki Commons'
  1. XWiki Commons
  2. XCOMMONS-3728

Fail the build when a backward-compatibility AspectJ advice is not weaved

    XMLWordPrintable

Details

    • Unknown
    • N/A

    Description

      Problem

      Backward-compatibility in the legacy modules relies on AspectJ aspects being weaved into the modules they wrap. When an advice stops matching (because the API it protects was moved, renamed or removed), AspectJ only emits a warning:

      advice ... has not been applied [Xlint:adviceDidNotMatch]
      

      Warnings are easy to miss in a full build, so a broken backward-compatibility layer can ship unnoticed. XRENDERING-809 is a concrete case where a legacy advice silently did nothing for several releases.

      Proposal

      In the shared aspectj-maven-plugin pluginManagement configuration of the xwiki-commons parent pom, promote AspectJ lint messages to errors (<Xlint>error</Xlint>) so that any weaving problem fails the build instead of printing an easy-to-miss warning.

      This only affects modules that actually run aspectj:compile (i.e. the legacy aspect modules across Commons, Rendering and Platform). For those modules an unmatched advice — and related lints such as typeNotExposedToWeaver, cantFindType and invalidAbsoluteTypeName — always signals a real backward-compatibility regression, so failing the build is the desired behaviour.

      A module that ever needs to downgrade a specific lint can still do so locally via the plugin's Xlintfile parameter, which overrides Xlint.

      Attachments

        Issue Links

          Activity

            People

              vmassol Vincent Massol
              vmassol Vincent Massol
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: