Optimize not to call getServerFeatures() again when optimize is set.
@@ -172,8 +172,10 @@ public class GenerateFeaturesMojo extends ServerFeatureSupport {
} catch (BinaryScannerUtil.NoRecommendationException noRecommendation) {
throw new MojoExecutionException(String.format(BinaryScannerUtil.BINARY_SCANNER_CONFLICT_MESSAGE3, noRecommendation.getConflicts()));
} catch (BinaryScannerUtil.FeatureModifiedException featuresModified) {
- Set<String> userFeatures = getServerFeatures(servUtil, generatedFiles, true); // user features excludes generatedFiles
+ Set<String> userFeatures = (optimize) ? existingFeatures :
+ getServerFeatures(servUtil, generatedFiles, true); // user features excludes generatedFiles
Set<String> modifiedSet = featuresModified.getFeatures(); // a set that works after being modified by the scanner
+
if (modifiedSet.containsAll(userFeatures)) {
// none of the user features were modified, only features which were generated earlier.
log.debug("FeatureModifiedException, modifiedSet containsAll userFeatures, pass modifiedSet on to generateFeatures");
