Skip to content

Commit a289217

Browse files
committed
Content Package Validator: Update to filevault-package-maven-plugin 1.1.8.
Content Package Validator: Load default node types for validation from biz.netcentric.aem:aem-nodetypes and io.wcm.tooling.nodetypes:io.wcm.tooling.nodetypes.wcmio.
1 parent 7d057ec commit a289217

7 files changed

Lines changed: 371 additions & 3 deletions

File tree

changes.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@
2727
<action type="update" dev="sseifert">
2828
conga-aem-maven-plugin:cloudmanager-all-package: Ensure dependencies of sub packages are managed as well.
2929
</action>
30+
<action type="update" dev="sseifert">
31+
Content Package Validator: Update to filevault-package-maven-plugin 1.1.8.
32+
</action>
33+
<action type="update" dev="sseifert">
34+
Content Package Validator: Load default node types for validation from biz.netcentric.aem:aem-nodetypes and io.wcm.tooling.nodetypes:io.wcm.tooling.nodetypes.wcmio.
35+
</action>
3036
</release>
3137

3238
<release version="1.14.6" date="2021-06-27">

conga-aem-plugin/pom.xml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,16 @@
9292
</exclusion>
9393
</exclusions>
9494
</dependency>
95+
<dependency>
96+
<groupId>biz.netcentric.aem</groupId>
97+
<artifactId>aem-nodetypes</artifactId>
98+
<scope>compile</scope>
99+
</dependency>
100+
<dependency>
101+
<groupId>io.wcm.tooling.nodetypes</groupId>
102+
<artifactId>io.wcm.tooling.nodetypes.wcmio</artifactId>
103+
<scope>compile</scope>
104+
</dependency>
95105

96106
<dependency>
97107
<groupId>io.wcm.tooling.commons</groupId>

conga-aem-plugin/src/main/java/io/wcm/devops/conga/plugins/aem/validator/ContentPackageValidator.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,16 @@
3535
import org.apache.maven.plugin.MojoExecutionException;
3636
import org.apache.maven.plugin.MojoFailureException;
3737

38+
import com.google.common.collect.ImmutableMap;
39+
3840
import io.wcm.devops.conga.generator.spi.ImplicitApplyOptions;
3941
import io.wcm.devops.conga.generator.spi.ValidationException;
4042
import io.wcm.devops.conga.generator.spi.ValidatorPlugin;
4143
import io.wcm.devops.conga.generator.spi.context.FileContext;
4244
import io.wcm.devops.conga.generator.spi.context.ValidatorContext;
4345
import io.wcm.devops.conga.generator.util.FileUtil;
4446
import io.wcm.devops.conga.model.util.MapExpander;
47+
import io.wcm.devops.conga.model.util.MapMerger;
4548
import io.wcm.devops.conga.tooling.maven.plugin.util.MavenContext;
4649
import io.wcm.tooling.commons.packmgr.util.ContentPackageProperties;
4750

@@ -59,6 +62,10 @@ public class ContentPackageValidator implements ValidatorPlugin {
5962

6063
private static final String OPTION_VALIDATORS_SETTINGS = "contentPackage.validatorsSettings";
6164

65+
// apply default validation for AEM and wcm.io node types
66+
private static final Map<String, Object> DEFAULT_VALIDATORS_SETTINGS = ImmutableMap.of("jackrabbit-nodetypes",
67+
ImmutableMap.of("options", ImmutableMap.of("cnds", "tccl:aem.cnd,tccl:wcmio.cnd")));
68+
6269
@Override
6370
public String getName() {
6471
return NAME;
@@ -114,9 +121,11 @@ private void validateContentPackage(File packageFile, ValidatorContext context,
114121
setProperty(mojo, "repositorySystem", mavenContext.getRepositorySystem());
115122
setProperty(mojo, "resolutionErrorHandler", mavenContext.getResolutionErrorHandler());
116123
setProperty(mojo, "buildContext", mavenContext.getBuildContext());
124+
setProperty(mojo, "attachedArtifacts", Collections.emptyList());
117125

118126
Object validatorsSettings = MapExpander.getDeep(context.getOptions(), OPTION_VALIDATORS_SETTINGS);
119-
setProperty(mojo, "validatorsSettings", toValidatorsSettings(toMap(validatorsSettings)));
127+
Map<String,Object> validatorSettingsMap = MapMerger.merge(toMap(validatorsSettings), DEFAULT_VALIDATORS_SETTINGS);
128+
setProperty(mojo, "validatorsSettings", toValidatorsSettings(validatorSettingsMap));
120129

121130
mojo.execute();
122131
}

example/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
<dependency>
6666
<groupId>io.wcm.devops.conga.plugins</groupId>
6767
<artifactId>io.wcm.devops.conga.plugins.aem</artifactId>
68-
<version>1.14.5-SNAPSHOT</version>
68+
<version>1.14.7-SNAPSHOT</version>
6969
</dependency>
7070

7171
</dependencies>

example/src/main/roles/aem.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,24 @@ files:
8282
filters:
8383
- filter: /etc/replication/agents.author
8484

85+
# Oak Index
86+
- file: aem-cms-oak-index.json
87+
dir: packages
88+
template: aem-cms-oak-index.json.hbs
89+
postProcessors:
90+
- aem-contentpackage
91+
postProcessorOptions:
92+
contentPackage:
93+
name: schindler-aem-aem-cms-oak-index
94+
packageType: application
95+
rootPath: /oak:index
96+
allowIndexDefinitions: true
97+
validatorOptions:
98+
contentPackage.validatorsSettings:
99+
jackrabbit-packagetype:
100+
options:
101+
immutableRootNodeNames: apps,libs,oak:index
102+
85103
# Download AEM content package and extract properties
86104
- url: mvn:io.wcm/io.wcm.caconfig.editor.package//zip
87105
dir: packages

0 commit comments

Comments
 (0)