Expand my Community achievements bar.

SOLVED

Single maven install for both author and publish AEM

Avatar

Level 6

I am trying to install AEM project in Author and Publish by using the below maven command. but it installs only in publish. Is it possible to  install in both?

mvn -Daem.host=localhost -Daem.port=4502  -Daem.publish.host=localhost -Daem.publish.port=4503 -PautoInstallPackagePublish,autoInstallPackage  clean install

1 Accepted Solution

Avatar

Correct answer by
Level 10

I have never done this - always used Maven for 1 CQ instance at a time. See the AEM docs on this: 

https://docs.adobe.com/docs/en/cq/5-6-1/core/how_to/how_to_use_the_vlttool/vlt-mavenplugin.html

View solution in original post

3 Replies

Avatar

Correct answer by
Level 10

I have never done this - always used Maven for 1 CQ instance at a time. See the AEM docs on this: 

https://docs.adobe.com/docs/en/cq/5-6-1/core/how_to/how_to_use_the_vlttool/vlt-mavenplugin.html

Avatar

Employee Advisor

Hi,

it's doable, but you need to build your own Maven profile then.

Jörg

Avatar

Level 1

Add this profile to your Maven setup.

<profile>
            <id>autoInstallPackageAuthorAndPublish</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <build>
                <pluginManagement>
                    <plugins>
                        <plugin>
                            <groupId>org.apache.jackrabbit</groupId>
                            <artifactId>filevault-package-maven-plugin</artifactId>
                            <executions>
                                <execution>
                                    <id>create-package</id>
                                    <goals>
                                        <goal>package</goal>
                                    </goals>
                                </execution>
                            </executions>
                        </plugin>
                        <plugin>
                            <groupId>com.day.jcr.vault</groupId>
                            <artifactId>content-package-maven-plugin</artifactId>
                            <executions>
                                <execution>
                                    <id>install-package-author</id>
                                    <goals>
                                        <goal>install</goal>
                                    </goals>
                                    <configuration>
                                        <targetURL>http://${aem.host}:${aem.port}/crx/packmgr/service.jsp</targetURL>
                                    </configuration>
                                </execution>
                                <execution>
                                <id>install-package-publish</id>
                                <goals>
                                    <goal>install</goal>
                                </goals>
                                <configuration>
                                    <targetURL>
                                        http://${aem.publish.host}:${aem.publish.port}/crx/packmgr/service.jsp
                                    </targetURL>
                                </configuration>
                            </execution>
                            </executions>
                        </plugin>
                    </plugins>
                </pluginManagement>
            </build>
        </profile>


Now use the following command:

mvn -s /path/to/settings.xml clean install -PautoInstallPackageAuthorAndPublish -Padobe-public