public boolean requiresProject( MavenSession session ) { List<String> goals = session.getGoals(); if ( goals != null ) { for ( String goal : goals ) { if ( !isGoalSpecification( goal ) ) { return true; } } } return false; }
public List<TaskSegment> calculateTaskSegments( MavenSession session ) throws PluginNotFoundException, PluginResolutionException, PluginDescriptorParsingException, MojoNotFoundException, NoPluginFoundForPrefixException, InvalidPluginDescriptorException, PluginVersionResolutionException, LifecyclePhaseNotFoundException, LifecycleNotFoundException { MavenProject rootProject = session.getTopLevelProject(); List<String> tasks = session.getGoals(); if ( ( tasks == null || tasks.isEmpty() ) && !StringUtils.isEmpty( rootProject.getDefaultGoal() ) ) { tasks = Arrays.asList( StringUtils.split( rootProject.getDefaultGoal() ) ); } return calculateTaskSegments( session, tasks ); }
final String determineGoal() { String goal = (String) session.getGoals().get(0); goal = goal.substring(goal.lastIndexOf(":") + 1); return goal; }
private String getGoal() { for(String mvnGoal: mavenSession.getGoals()){ if(mvnGoal.contains("openmrs-sdk")){ String goal = mvnGoal.substring(mvnGoal.lastIndexOf(":")+1); return goal.substring(0,1).toUpperCase() + goal.substring(1); } } return null; } }
@Override public final void execute() throws MojoExecutionException, MojoFailureException { if (skipTests) { if (session.getGoals().contains("jmeter:gui")) { if (!"default-cli".equals(mojoExecution.getExecutionId()) && !"compile".equals(mojoExecution.getLifecyclePhase())) { getLog().info("Performance tests are skipped."); return; } } else { getLog().info("Performance tests are skipped."); return; } } // load maven proxy if needed if (useMavenProxy && proxyConfig == null) { loadMavenProxy(); } doExecute(); }
void act() throws GitAPIException, IOException { Set<MavenProject> changed = changedProjects.get(); printDelimiter(); logProjects(changed, "Changed Artifacts:"); Set<MavenProject> impacted = changed.stream() .flatMap(this::streamProjectWithDependents) .collect(Collectors.toCollection(LinkedHashSet::new)); if (!configProvider.get().buildAll) { Set<MavenProject> rebuild = getRebuildProjects(impacted); if (rebuild.isEmpty()) { logger.info("No changed artifacts to build. Executing validate goal on current project only."); mavenSession.setProjects(Collections.singletonList(mavenSession.getCurrentProject())); mavenSession.getGoals().clear(); mavenSession.getGoals().add("validate"); } else if (!configProvider.get().forceBuildModules.isEmpty()) { Stream<MavenProject> forceBuildModules = mavenSession.getProjects().stream() .filter(p -> matchesAny(p.getArtifactId(), configProvider.get().forceBuildModules)) .filter(p -> !rebuild.contains(p)) .map(this::applyNotImpactedModuleArgs); mavenSession.setProjects( Stream.concat(forceBuildModules, rebuild.stream()).collect(Collectors.toList())); } else { mavenSession.setProjects(new ArrayList<>(rebuild)); } } else { mavenSession.getProjects().stream() .filter(p -> !impacted.contains(p)) .forEach(this::applyNotImpactedModuleArgs); } }
private MavenExecutionRequest getMavenExecutionRequest() { MavenExecutionRequest request = DefaultMavenExecutionRequest.copy(session.getRequest()); request.setStartTime(session.getStartTime()); request.setExecutionListener(null); if (! initialBuild && session.getGoals().contains("clean")) { // Here the package phase is required to restore the runtime environment request.setGoals(ImmutableList.of("clean", "package", "wisdom:internal-run")); } else { // It is safer to re-execute the package phase to have the new classes... request.setGoals(ImmutableList.of("package", "wisdom:internal-run")); } return request; }
,oldSession.getEventDispatcher() ,reactorManager ,oldSession.getGoals() ,oldSession.getExecutionRootDirectory() ,oldSession.getExecutionProperties()
public final void execute() throws MojoExecutionException, MojoFailureException { String targetArtifactId = detectAmpsProduct(); if (targetArtifactId != null && session.getGoals().size() > 0) { // We only pass in the first goal since we know the shell scripts only pass in one goal String goal = determineGoal(); executeMojo( plugin( groupId("com.atlassian.maven.plugins"), artifactId(targetArtifactId), version(VersionUtils.getVersion()) //ignored anyway ), goal(goal), configuration(), getExecutionEnvironment()); } else { throw new MojoFailureException("Couldn't detect an AMPS product to dispatch to"); } }
List<String> goals = execEnv.getMavenSession().getGoals(); if (goals.contains("alfresco:run")) { sysProperties.put("skipTests", "true");