void (RepositoryEvent event) { RepositoryEvent.EventType type = event.getType(); // optimization to prevent unnecessary CPU and memory pressure on many irrelevant events // only these events are currently used (see MavenEventType) if (type != RepositoryEvent.EventType.ARTIFACT_DOWNLOADING && type != RepositoryEvent.EventType.ARTIFACT_RESOLVING) return; String errMessage = event.getException() == null ? "" : event.getException().getMessage(); String path = event.getFile() == null ? "" : event.getFile().getPath(); String artifactCoord = event.getArtifact() == null ? "" : event.getArtifact().toString(); printMavenEventInfo(type, "path", path, "artifactCoord", artifactCoord, "error", errMessage); }