throw new MojoExecutionException(e.getMessage(), e);
} catch (ArtifactNotFoundException e) {
throw new MojoExecutionException(e.getMessage(), e);
}
ProjectBuildingRequest request = new DefaultProjectBuildingRequest();
request.setProcessPlugins(true);
request.setProfiles(request.getProfiles());
request.setActiveProfileIds(session.getRequest().getActiveProfiles());
request.setInactiveProfileIds(session.getRequest().getInactiveProfiles());
request.setRemoteRepositories(session.getRequest().getRemoteRepositories());
request.setSystemProperties(session.getSystemProperties());
request.setUserProperties(session.getUserProperties());
request.setRemoteRepositories(session.getRequest().getRemoteRepositories());
request.setPluginArtifactRepositories(session.getRequest().getPluginArtifactRepositories());
request.setRepositorySession(session.getRepositorySession());
request.setLocalRepository(localRepository);
request.setBuildStartTime(session.getRequest().getStartTime());
request.setResolveDependencies(true);
request.setValidationLevel(ModelBuildingRequest.VALIDATION_LEVEL_STRICT);
MavenProject latestProject;
try {
latestProject = projectBuilder.build(latestArtifact.getFile(), request).getProject();
} catch (ProjectBuildingException e) {
throw new MojoExecutionException(e.getMessage(), e);