0

I'm newer to AEM/CRX/JCR stuff so I feel like there might just be something fundamental I'm missing but I just can't find the answer anywhere. I've looked at this question already.

Here's the issue:

  • I change an attribute value in some .content.xml file (e.g. jcr:title="NewValue") from my local file system.
  • I run mvn clean install -Pauto-deploy (auto-deploy profile info attached below)
  • After it finishes, I open http://localhost:4502/crx/de/index.jsp and navigate to the jcr:content node I modified.
  • The old value of the property is still shown (e.g. jcr:title="OldValue").

If I delete the jcr:content node using CRXDE lite and then run maven again, the node shows fine with the updated values. So I know that the node is moving from my local file system into CRX fine, it just doesn't seem to be overwriting when there's already a value present. I feel like there must be some setting I'm missing or have implemented incorrectly.

Let me know if more info is required. Please note that I do not want to use vlt directly since our build pipeline uses maven. Thanks in advance for the help!

auto-deploy profile (vault plugin config)

<plugin>
    <groupId>com.day.jcr.vault</groupId>
    <artifactId>maven-vault-plugin</artifactId>
    <version>0.0.10</version>
    <executions>
        <execution>
            <id>install-package</id>
            <goals>
                <goal>install</goal>
            </goals>
            <configuration>
                <verbose>true</verbose>
                <packageFile>${project.build.directory}/${project.build.finalName}.zip</packageFile>
                <targetURL>http://${cq.host}:${cq.port}/crx/packmgr/service.jsp</targetURL>
                <userId>${cq.user}</userId>
                <password>${cq.password}</password>
                <properties>
                  <acHandling>Overwrite</acHandling>
                </properties>
            </configuration>
        </execution>
    </executions>
</plugin>

Edit maven-resources-plugin

<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>
                <warSourceExcludes>**/*.scss</warSourceExcludes>
                <resources>
                    <resource>
                        <directory>${basedir}/src/main/content</directory>
                        <filtering>true</filtering>
                        <excludes>
                            <exclude>**/.svn</exclude>
                            <exclude>**/.vlt</exclude>
                            <exclude>**/*.scss</exclude>
                            <exclude>**/.vltignore</exclude>
                            <exclude>**/.DS_Store</exclude>
                            <exclude>**/*.scss</exclude>
                        </excludes>
                    </resource>
                </resources>
            </configuration>
        </execution>
    </executions>
</plugin>

Edit I realized it may be worth noting that the .content.xml file I'm trying to modify and push is in /etc/designs.

Community
  • 1
  • 1
Uncharted Space
  • 861
  • 7
  • 13

2 Answers2

0

There are two other plugins which are configured to build the package first. The purpose of maven-vault-plugin is only for deployment to AEM.

Look at your POM with plugin configurations for-

  • maven-resources-plugin - This will be copying your content XML to a target location
  • content-package-maven-plugin - this will be the one generating the package

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

Another thing to verify is to extract 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.

In case you need further help, please share details on the configuration of these two plugins as well.

Ameesh Trikha
  • 1,652
  • 2
  • 12
  • 18
  • I've added the maven-resources-plugin config to the question. I searched my project and the effective POM but didn't find any references to content-package-maven-plugin. I can see the changes to .content.xml reflected both in the package that is generated locally and in the installed content package downloaded from the local AEM instance. It's only in CRXDE lite that I don't see the change to the folder property (even after refreshing). – Uncharted Space Jul 13 '16 at 15:13
  • Then the only possible reason I can think of is that your xml is not well formed, there is something missing or breaking it. You could check it with xml validator or in case you have VaultClipse (Eclipse) or IntelliVault (IntelliJ) or plain Vlt tool configured, try pushing the updated xml only, if there are issues you will see those in logs. – Ameesh Trikha Jul 13 '16 at 16:30
  • I did one more test by updating a .content.xml file present in /apps/[project name]/components. This update showed fine in CRXDE lite. But when I locally change a .content.xml file in /etc/designs/[project name] it's not reflected. Both paths are allowed by the filter.xml. I was thinking, does /etc/designs have or need some special permissions since it's typically used by design dialogs? – Uncharted Space Aug 19 '16 at 15:11
0

Typically, you should have this structure:

jcr_root
META-INF
--- vault
    --- config.xml
    --- filter.xml
    --- settings.xml

in filter.xml, there will be some rules for including/excluding nodes, make sure your xml file isn't excluded.

Ahmed Musallam
  • 9,523
  • 4
  • 27
  • 47