April 26, 2020
Estimated Post Reading Time ~

Changing a .content.xml file locally is not reflecting in CRX after maven build

If .content.xml file is changed locally and changes are not reflecting in crx then check maven-resources-plugin.

Add below plugin in pom.xml of UI module.(aem-sample/aem-content-ui/pom.xml).

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<executions>
<execution>
<id>copy-content-resources</id>
<phase>process-resources</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/vault-work</outputDirectory>
<resources>
<resource>
<directory>${basedir}/src/main/content</directory>
<filtering>true</filtering>
<excludes>
<exclude>**/.svn</exclude>
<exclude>**/.vlt</exclude>
<exclude>**/.vltignore</exclude>
<exclude>**/.DS_Store</exclude>
<exclude>/etc/designs/${project.parent.artifactId}/jcr:content(/.*)?</exclude>
</excludes>
</resource>
</resources>
</configuration>
</execution>
</plugin>

For maven-resources-plugin check that its copying your .content.xml to target folder and for content-package-maven-plugin check that correct filter values are set.

We can also verify by extracting the generated package and check if it has the changes or not or look at a vault-work directory in target and get to the directory in which you have changed the .content.xml, verify if it has changes. If your changes are there in vault-works then the maven-resources-plugin is working absolutely fine and the issue may be with the content-package-maven-plugin.


By aem4beginner

No comments:

Post a Comment

If you have any doubts or questions, please let us know.