Uploaded image for project: 'Maven Surefire'
  1. Maven Surefire
  2. SUREFIRE-2196

maven-surefire-report-plugin:failsafe-report-only failed: Unmatched braces in the pattern

    XMLWordPrintableJSON

Details

    Description

      After migrating maven-surefire-report-plugin to use AbstractMavenReportRenderer, if error message of test contains not closed braces ({), the plugin throws exception:

      Caused by: java.lang.IllegalArgumentException: Unmatched braces in the pattern.
          at org.apache.maven.reporting.AbstractMavenReportRenderer.applyPattern (AbstractMavenReportRenderer.java:714)
          at org.apache.maven.reporting.AbstractMavenReportRenderer.linkPatternedText (AbstractMavenReportRenderer.java:512)
          at org.apache.maven.reporting.AbstractMavenReportRenderer.tableCell (AbstractMavenReportRenderer.java:312)
          at org.apache.maven.reporting.AbstractMavenReportRenderer.tableCell (AbstractMavenReportRenderer.java:287)
          at org.apache.maven.reporting.AbstractMavenReportRenderer.tableRow (AbstractMavenReportRenderer.java:335)
          at org.apache.maven.plugins.surefire.report.SurefireReportRenderer.constructTestCaseSection (SurefireReportRenderer.java:433)
      

      This is happened because method tableCell of AbstractMavenReportRenderer has logic for resolving link patterns "{[text], [href]}".
      You need to review all calls to AbstractMavenReportRenderer::tableRow, AbstractMavenReportRenderer::tableCell, and escape all braces.
      As I see, the next code needs to be updated:

       

      Attachments

        Activity

          People

            michael-o Michael Osipov
            grigaland Grigory Mischenko
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: