protected void parse(int threadId,
                       MavenEventType type,
                       Map<String, String> parameters,
                       Consumer<? super BuildEvent> messageConsumer) {
    switch (type) {
      case SESSION_STARTED -> {
        List<String> projectsInReactor = getProjectsInReactor(parameters);
        myContext.setProjectsInReactor(projectsInReactor);
      }
      case SESSION_ENDED -> doFinishSession(messageConsumer, myContext);
      case PROJECT_STARTED -> {
        MavenParsingContext.ProjectExecutionEntry execution = myContext.getProject(threadId, parameters, true);
        if (execution == null) {
          MavenLog.LOG.debug("Not found for " + parameters);
        }
        else {
          messageConsumer
            .accept(new StartEventImpl(execution.getId(), execution.getParentId(), System.currentTimeMillis(), execution.getName()));
        }
      }
      case MOJO_STARTED -> {
        MavenParsingContext.MojoExecutionEntry mojoExecution = myContext.getMojo(threadId, parameters, true);
        doStart(messageConsumer, mojoExecution);
      }
      case MOJO_SUCCEEDED -> {
        stopFakeDownloadNode(threadId, parameters, messageConsumer);
        MavenParsingContext.MojoExecutionEntry mojoExecution = myContext.getMojo(threadId, parameters, false);
        doComplete(messageConsumer, mojoExecution);
      }
      case MOJO_FAILED -> {
        stopFakeDownloadNode(threadId, parameters, messageConsumer);
        MavenParsingContext.MojoExecutionEntry mojoExecution = myContext.getMojo(threadId, parameters, false);
        if (mojoExecution == null) {
          MavenLog.LOG.debug("Not found id for " + parameters);
        }
        else {
          messageConsumer.accept(
            new FinishEventImpl(mojoExecution.getId(), mojoExecution.getParentId(), System.currentTimeMillis(), mojoExecution.getName(),
                                new MavenTaskFailedResultImpl(parameters.get("error"))));
          mojoExecution.complete();
        }
      }
      case MOJO_SKIPPED -> {
        stopFakeDownloadNode(threadId, parameters, messageConsumer);
        MavenParsingContext.MojoExecutionEntry mojoExecution = myContext.getMojo(threadId, parameters, false);
        doSkip(messageConsumer, mojoExecution);
      }
      case PROJECT_SUCCEEDED -> {
        stopFakeDownloadNode(threadId, parameters, messageConsumer);
        MavenParsingContext.ProjectExecutionEntry execution = myContext.getProject(threadId, parameters, false);
        doComplete(messageConsumer, execution);
      }
      case PROJECT_SKIPPED -> {
        MavenParsingContext.ProjectExecutionEntry execution = myContext.getProject(threadId, parameters, false);
        doSkip(messageConsumer, execution);
      }
      case PROJECT_FAILED -> {
        stopFakeDownloadNode(threadId, parameters, messageConsumer);
        MavenParsingContext.ProjectExecutionEntry execution = myContext.getProject(threadId, parameters, false);
        myContext.setProjectFailure(true);
        doError(messageConsumer, execution, parameters.get("error"));
      }
      case ARTIFACT_RESOLVED -> artifactResolved(threadId, parameters, messageConsumer);
      case ARTIFACT_DOWNLOADING -> artifactDownloading(threadId, parameters, messageConsumer);
    }
  }
protected void parse(int threadId,
                       MavenEventType type,
                       Map<String, String> parameters,
                       Consumer<? super BuildEvent> messageConsumer)