Class ParserUtils


  • public class ParserUtils
    extends Object
    Parsing utils.
    • Constructor Detail

      • ParserUtils

        public ParserUtils()
    • Method Detail

      • parsePluginOutput

        public static <D> Map<String,​D> parsePluginOutput​(Stream<String> lines,
                                                                Pattern executionLinePattern,
                                                                Function<Iterator<String>,​D> blockParser)
        Iterates over the given lines, identifying plugin execution blocks with the given pattern and parses the plugin output with the given parser.

        This method assumes that the given pattern matches at most once for each module.

        The given pattern must include a module group that captures the module that the plugin runs on (without the scala suffix!).

        Type Parameters:
        D - block parser output
        Parameters:
        lines - maven output lines
        executionLinePattern - pattern that matches plugin executions
        blockParser - parser for the plugin block
        Returns:
        map containing the parser result for each module