// and the previous build didn't specify that we need a full build
// and we're on Maven 2.1 or later
// and there's at least one module listed in changedModules,
// then do the Maven incremental build commands.
// If there are no changed modules, we're building everything anyway.
boolean maven2_1orLater = new ComparableVersion (mavenVersion).compareTo( new ComparableVersion ("2.1") ) >= 0;
boolean needsFullBuild = getPreviousCompletedBuild() != null &&
getPreviousCompletedBuild().getAction(NeedsFullBuildAction.class) != null;
if (project.isIncrementalBuild() && !needsFullBuild && maven2_1orLater && !changedModules.isEmpty()) {
margs.add("-amd");
margs.add("-pl", Util.join(changedModules, ","));