1919 */
2020package io .wcm .devops .conga .plugins .aem .maven .allpackage ;
2121
22+ import static io .wcm .devops .conga .generator .util .FileUtil .getCanonicalPath ;
2223import static io .wcm .devops .conga .plugins .aem .maven .allpackage .RunModeUtil .RUNMODE_AUTHOR ;
2324import static io .wcm .devops .conga .plugins .aem .maven .allpackage .RunModeUtil .RUNMODE_PUBLISH ;
2425import static org .apache .jackrabbit .vault .packaging .PackageProperties .NAME_DEPENDENCIES ;
4142import org .apache .jackrabbit .vault .packaging .Dependency ;
4243import org .apache .jackrabbit .vault .packaging .DependencyUtil ;
4344import org .apache .jackrabbit .vault .packaging .VersionRange ;
45+ import org .apache .maven .plugin .logging .Log ;
46+ import org .apache .maven .plugin .logging .SystemStreamLog ;
4447
4548import io .wcm .devops .conga .plugins .aem .maven .model .ContentPackageFile ;
4649import io .wcm .tooling .commons .contentpackagebuilder .ContentPackage ;
@@ -56,6 +59,7 @@ public final class AllPackageBuilder {
5659 private final String groupName ;
5760 private final String packageName ;
5861 private boolean autoDependencies ;
62+ private Log log ;
5963
6064 /**
6165 * @param targetFile Target file
@@ -78,6 +82,22 @@ public AllPackageBuilder autoDependencies(boolean value) {
7882 return this ;
7983 }
8084
85+ /**
86+ * @param value Maven logger
87+ * @return this
88+ */
89+ public AllPackageBuilder logger (Log value ) {
90+ this .log = value ;
91+ return this ;
92+ }
93+
94+ private Log getLog () {
95+ if (this .log == null ) {
96+ this .log = new SystemStreamLog ();
97+ }
98+ return this .log ;
99+ }
100+
81101 /**
82102 * Build "all" content package.
83103 * @param contentPackages Content packages (invalid will be filtered out)
@@ -86,9 +106,14 @@ public AllPackageBuilder autoDependencies(boolean value) {
86106 */
87107 public boolean build (List <ContentPackageFile > contentPackages ) throws IOException {
88108
109+ // generate warnings for each invalid content packages that is skipped
110+ contentPackages .stream ()
111+ .filter (pkg -> !isValid (pkg ))
112+ .forEach (pkg -> getLog ().warn ("Skipping content package without package type: " + getCanonicalPath (pkg .getFile ())));
113+
89114 // collect AEM content packages for this node
90115 List <ContentPackageFile > validContentPackages = contentPackages .stream ()
91- .filter (AllPackageBuilder :: isValid )
116+ .filter (pkg -> isValid ( pkg ) )
92117 .collect (Collectors .toList ());
93118 if (validContentPackages .isEmpty ()) {
94119 return false ;
0 commit comments