if (options.hasOption(PROJECT_DEPENDENCY_TASK_NAMES) && options.hasOption(NO_PROJECT_DEPENDENCY_REBUILD)) {
throw new CommandLineArgumentException(String.format(
"Error: The -%s and -%s options cannot be used together.", PROJECT_DEPENDENCY_TASK_NAMES,
NO_PROJECT_DEPENDENCY_REBUILD));
} else if (options.hasOption(NO_PROJECT_DEPENDENCY_REBUILD)) {
startParameter.setProjectDependenciesBuildInstruction(new ProjectDependenciesBuildInstruction(null));
} else if (options.hasOption(PROJECT_DEPENDENCY_TASK_NAMES)) {
List<String> normalizedTaskNames = new ArrayList<String>();
for (String taskName : options.option(PROJECT_DEPENDENCY_TASK_NAMES).getValues()) {
normalizedTaskNames.add(taskName);
}
startParameter.setProjectDependenciesBuildInstruction(new ProjectDependenciesBuildInstruction(
normalizedTaskNames));
}
if (!options.getExtraArguments().isEmpty()) {
startParameter.setTaskNames(options.getExtraArguments());