@Test public void shouldPassAdditionalArguments() { Location pom = FileLocation.of(getClass().getResource("/com/sonar/orchestrator/build/MavenBuildTest/pom.xml")); MavenBuild build = MavenBuild.create(pom).addGoal("clean").addArguments("-PnotExists"); BuildResult result = new MavenBuildExecutor().execute(build, Configuration.createEnv(), new HashMap<>()); assertThat(result.getLogs().length()).isGreaterThan(0); assertThat(result.getLogs()).contains("[WARNING] The requested profile \"notExists\" could not be activated because it does not exist."); }
@Override BuildResult execute(MavenBuild build, Configuration config, Map<String, String> adjustedProperties, CommandExecutor commandExecutor) { BuildResult result = new BuildResult(); for (String goal : build.getGoals()) { appendCoverageArgumentToOpts(build.getEnvironmentVariables(), config, MAVEN_OPTS); executeGoal(build, config, adjustedProperties, goal, result, commandExecutor); } return result; }
MavenBuildExecutor extends AbstractBuildExecutor<MavenBuild> { @Override BuildResult execute(MavenBuild build, Configuration config, Map<String, String> adjustedProperties, CommandExecutor commandExecutor) { BuildResult result = new BuildResult(); for (String goal : build.getGoals()) { appendCoverageArgumentToOpts(build.getEnvironmentVariables(), config, MAVEN_OPTS); executeGoal(build, config, adjustedProperties, goal, result, commandExecutor); } return result; } }
MavenBuildExecutor extends AbstractBuildExecutor<MavenBuild> { @Override BuildResult execute(MavenBuild build, Configuration config, Map<String, String> adjustedProperties, CommandExecutor commandExecutor) { BuildResult result = new BuildResult(); for (String goal : build.getGoals()) { appendCoverageArgumentToOpts(build.getEnvironmentVariables(), config, MAVEN_OPTS); executeGoal(build, config, adjustedProperties, goal, result, commandExecutor); } return result; } MavenBuildExecutor(Os os);  MavenBuildExecutor(); }
MavenBuildExecutor extends AbstractBuildExecutor<MavenBuild> { @Override BuildResult execute(MavenBuild build, Configuration config, Map<String, String> adjustedProperties, CommandExecutor commandExecutor) { BuildResult result = new BuildResult(); for (String goal : build.getGoals()) { appendCoverageArgumentToOpts(build.getEnvironmentVariables(), config, MAVEN_OPTS); executeGoal(build, config, adjustedProperties, goal, result, commandExecutor); } return result; } MavenBuildExecutor(Os os);  MavenBuildExecutor();  }
MavenBuildExecutor extends AbstractBuildExecutor<MavenBuild> { @Override BuildResult execute(MavenBuild build, Configuration config, Map<String, String> adjustedProperties, CommandExecutor commandExecutor) { BuildResult result = new BuildResult(); for (String goal : build.getGoals()) { appendCoverageArgumentToOpts(build.getEnvironmentVariables(), config, MAVEN_OPTS); executeGoal(build, config, adjustedProperties, goal, result, commandExecutor); } return result; } MavenBuildExecutor(Os os);  MavenBuildExecutor();   }