Overwrite Translations in CRX with content-package-maven plugin | Community
Skip to main content
nickt39971962
Level 2
Aug 13, 2019 3:22 PM UTC
Solved

Overwrite Translations in CRX with content-package-maven plugin

When I add a new translation to the translations file and install the translation appears. When I change the translation and install the existing value is not overwritten. I'm struggling with the plugin's documentation to understand how to change this behaviour: to update an existing node value attribute.

Here's the configuration of the plugin:

          <plugin>

                    <groupId>com.day.jcr.vault</groupId>

                    <artifactId>content-package-maven-plugin</artifactId>

                    <version>0.5.24</version>

                    <extensions>true</extensions>

                    <configuration>

                        <packaging>zip</packaging>

                        <properties>

                            <acHandling>overwrite</acHandling>

                            <granite.suppressSnapshots>true</granite.suppressSnapshots>

                        </properties>

                        <failOnError>true</failOnError>

                        <install>true</install>

                        <verbose>true</verbose>

                        <useProxy>false</useProxy>

                    </configuration>

                </plugin>

<profile>

            <id>auto-install-package</id>

            <build>

                <pluginManagement>

                    <plugins>

                        <plugin>

                            <groupId>com.day.jcr.vault</groupId>

                            <artifactId>content-package-maven-plugin</artifactId>

                            <executions>

                                <execution>

                                    <id>install-package</id>

                                    <goals>

                                        <goal>install</goal>

                                    </goals>

                                    <configuration>

                                        <groupId>${project.groupId}</groupId>

                                        <artifactId>${project.artifactId}</artifactId>

                                        <targetURL>${cq.url}/crx/packmgr/service.jsp</targetURL>

                                        <userId>${cq.user}</userId>

                                        <password>${cq.password}</password>

                                    </configuration>

                                </execution>

                            </executions>

                        </plugin>

                    </plugins>

                </pluginManagement>

            </build>

        </profile>

The command I use to deploy is: mvn clean install -Pauto-install-package

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
user05162Accepted solution
Employee
Aug 14, 2019 12:50 PM UTC

I believe you need to use one of the following import modes depending on the requirement:

  • Replace: Content in the package that is not in the repository is added to the repository. Content in the repository is replaced with matching content in the package. Content is removed from the repository when it does not exist in the package.
  • Update: Content in the package that is not in the repository is added to the repository. Content in the repository is replaced with matching content in the package. Existing content gets removed from the repository. 

Check "Using Filters" at [1] for more details.

[1] Managing Packages Using Maven

7 replies

nickt39971962
Level 2
Aug 23, 2019 11:28 AM UTC

Our full parent POM looks like this:

Translate
nickt39971962
Level 2
Aug 23, 2019 11:25 AM UTC

It doesn't work at all on publish instances. It causes our deploys to fail with internal server error and no clues in the logs at all. Even just adding the following causes the error:

Translate
joerghoh
Employee
Aug 22, 2019 5:33 PM UTC

Can you share a minimal content-package where you can replicate this behavior? I am especially interested in the META-INF/vault/filter.xml file and the content in the respective path of the content-package.

Translate
nickt39971962
Level 2
Aug 15, 2019 5:58 PM UTC

Yes I saw that and tried putting those settings in a few places but on each occassion it failed to have the desired impact.

Translate
user05162Accepted solution
Employee
Aug 14, 2019 12:50 PM UTC

I believe you need to use one of the following import modes depending on the requirement:

  • Replace: Content in the package that is not in the repository is added to the repository. Content in the repository is replaced with matching content in the package. Content is removed from the repository when it does not exist in the package.
  • Update: Content in the package that is not in the repository is added to the repository. Content in the repository is replaced with matching content in the package. Existing content gets removed from the repository. 

Check "Using Filters" at [1] for more details.

[1] Managing Packages Using Maven

Translate
nickt39971962
Level 2
Aug 13, 2019 8:02 PM UTC

I don't believe the codebase is using any archtetype.

Translate
joerghoh
Employee
Aug 13, 2019 7:08 PM UTC

have you used the AEM archetype? Which version?

Jörg

Translate