- * If enabled, all from entries implicitly created intermediate directories - * are added as explicit entries to package. Also the rules with file - * information are applied to these directories. - *
- *- * To exclude directories like {@code /usr} from being added, you have - * to add these as prefix property (see {@code prefixes}). Directories - * that match a whole prefix or a sub path of it, are not added. - *
- */ - @Parameter(property = "rpm.generateIntermediateDirectories", defaultValue = "true") - boolean generateIntermediateDirectories = true; - - public void setGenerateIntermediateDirectories(final boolean generateIntermediateDirectories) { - this.generateIntermediateDirectories = generateIntermediateDirectories; - } - - /** * The prefix of the release if this is a snapshot build, will be suffixed * with the snapshot build id @@ -388,6 +366,31 @@ public void setGenerateIntermediateDirectories(final boolean generateIntermediat @Parameter(property = "rpm.prefixes") List+ * <generateIntermediateDirectories> + * <baseDirectory>/opt/mycompany/myapp</baseDirectory> + * <baseDirectory>/etc/mycompany</baseDirectory> + * </generateIntermediateDirectories> + *+ * + *
+ * For given base directories, all from entries implicitly created + * intermediate directories are added as explicit entries to package. + * Also the rules with file information are applied to these added directories. + *
+ *+ * To exclude directories like {@code /usr} from being added, you have + * to add these as prefix property (see {@code prefixes}). Directories + * that match a whole prefix or a sub path of it, are not added. + *
+ */ + @Parameter(property = "rpm.generateIntermediateDirectories") + List@@ -1100,7 +1103,7 @@ protected void fillPayload(final RpmBuilder builder) throws MojoFailureException } final ListenableBuilderContext ctx = new ListenableBuilderContext(builder.newContext()); - final MissingDirectoryTracker missingDirectoryTracker = new MissingDirectoryTracker(this.prefixes); + final MissingDirectoryTracker missingDirectoryTracker = new MissingDirectoryTracker(this.generateIntermediateDirectories); ctx.registerListener(missingDirectoryTracker); this.logger.debug("Building payload:"); @@ -1118,7 +1121,7 @@ protected void fillPayload(final RpmBuilder builder) throws MojoFailureException } ctx.removeListener(missingDirectoryTracker); - if (generateIntermediateDirectories) { + if (!generateIntermediateDirectories.isEmpty()) { missingDirectoryTracker.addMissingIntermediateDirectoriesToContext(ctx); } }