private Result<ProjectDependencyGraph> sessionDependencyGraph( final MavenSession session ) throws CycleDetectedException, DuplicateProjectException { Result<ProjectDependencyGraph> result = null; if ( session.getProjectDependencyGraph() != null || session.getProjects() != null ) { final ProjectDependencyGraph graph = new DefaultProjectDependencyGraph( session.getAllProjects(), session.getProjects() ); result = Result.success( graph ); } return result; }
request, session.getResult()); newSession.setAllProjects(session.getAllProjects()); newSession.setCurrentProject(project); newSession.setParallel(session.isParallel());
request, session.getResult()); newSession.setAllProjects(session.getAllProjects()); newSession.setCurrentProject(project); newSession.setParallel(session.isParallel());
private ModelBuildingRequest createModelBuildingRequest( File pomFile ) { FlattenModelResolver resolver = new FlattenModelResolver( this.localRepository, this.artifactFactory, this.dependencyResolver, this.session.getProjectBuildingRequest(), this.session.getAllProjects() ); Properties userProperties = this.session.getUserProperties(); List<String> activeProfiles = this.session.getRequest().getActiveProfiles(); // @formatter:off ModelBuildingRequest buildingRequest = new DefaultModelBuildingRequest().setUserProperties( userProperties ).setSystemProperties( System.getProperties() ).setPomFile( pomFile ).setModelResolver( resolver ).setActiveProfileIds( activeProfiles ); // @formatter:on return buildingRequest; }
@Override public void afterProjectsRead(MavenSession session) throws MavenExecutionException { // TODO installSnapshotEnabled if (stamper.isEnabled()) { for (MavenProject project : session.getAllProjects()) { for (Plugin plugin : project.getBuild().getPlugins()) { List<PluginExecution> pluginExecutionClones = new LinkedList<PluginExecution>(); for (PluginExecution execution : plugin.getExecutions()) { if (executionToBeCloned(plugin, execution.getId())) { PluginExecution pluginExecutionClone = clone(execution); pluginExecutionClones.add(pluginExecutionClone); } } for (PluginExecution pluginExecutionClone : pluginExecutionClones) { plugin.addExecution(pluginExecutionClone); logger.info("Added cloned pluginExecution :" + pluginExecutionClone.getId() + ":" + pluginExecutionClone.getPhase() + ":" + pluginExecutionClone.getGoals()); } } } } ExecutionListener originalExecutionListener = session.getRequest().getExecutionListener(); session.getRequest().setExecutionListener(new TeeExecutionListener(originalExecutionListener, new SnapshotExecutionListener(logger, stamper))); logger.info("[FreezeExtension]: " + SnapshotExecutionListener.class.getSimpleName() + " added"); }