List<MavenProjectProblem> (@Nullable File file, Throwable ex) { List<MavenProjectProblem> result = new ArrayList<>(); if (ex == null) return result; MavenServerGlobals.getLogger().print(ExceptionUtils.getFullStackTrace(ex)); myConsoleWrapper.info("Validation error:", ex); Artifact problemTransferArtifact = getProblemTransferArtifact(ex); if (ex instanceof IllegalStateException && ex.getCause() != null) { ex = ex.getCause(); } String path = file == null ? "" : file.getPath(); if (path.isEmpty() && ex instanceof ProjectBuildingException) { File pomFile = ((ProjectBuildingException)ex).getPomFile(); path = pomFile == null ? "" : pomFile.getPath(); } if (ex instanceof ProjectBuildingException) { String causeMessage = ex.getCause() != null ? ex.getCause().getMessage() : ex.getMessage(); result.add(MavenProjectProblem.createStructureProblem(path, causeMessage)); } else if (ex.getStackTrace().length > 0 && ex.getClass().getPackage().getName().equals("groovy.lang")) { myConsoleWrapper.error("Maven server structure problem", ex); StackTraceElement traceElement = ex.getStackTrace()[0]; result.add(MavenProjectProblem.createStructureProblem( traceElement.getFileName() + ":" + traceElement.getLineNumber(), ex.getMessage())); } else if (problemTransferArtifact != null) { myConsoleWrapper.error("[server] Maven transfer artifact problem: " + problemTransferArtifact); String message = getRootMessage(ex); MavenArtifact mavenArtifact = Maven40ModelConverter.convertArtifact(problemTransferArtifact, getLocalRepositoryFile()); result.add(MavenProjectProblem.createRepositoryProblem(path, message, true, mavenArtifact)); } else { myConsoleWrapper.error("Maven server structure problem", ex); result.add(MavenProjectProblem.createStructureProblem(path, getRootMessage(ex), true)); } return result; }