How to deploy code(ui,content,core) packages to multiple publish instances using content maven plugin? | Community
Skip to main content
GK-007
Level 9
March 19, 2019

How to deploy code(ui,content,core) packages to multiple publish instances using content maven plugin?

  • March 19, 2019
  • 2 replies
  • 7552 views

Hi All,

I am using content maven plugin(content-package-maven-plugin) to deploy code to pre-prod environment.i could able to deploy code without an issue if there is one author and one publish. One of the pre-prod environment has 1 author and 2 publish instances, here I am facing an issue that I could able to deploy code to one publish instance and not to another one.i have also created a separate profile with another id(e.g. autoInstallpackagePublish2) still i code is not deploying to other publish instance.

Is anyone done come across similar requirement and implemented the same. Please help me,i have spent lot of time but could not find any way to achieve this,

My project is created using Archtype-13.

<profile>

<id>autoInstallPackagePublish</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-publish</id>

                              <goals>

                                        <goal>install</goal>

                             </goals>

                    <configuration>

                                 <targetURL>http://publishaemqa1.xxxxx.com:80/crx/packmgr/service.jsp</targetURL>

                    </configuration>

                    </execution>

               <execution>

                    <id>install-package-publish2</id>

                             <goals>

                              <goal>install</goal>

                              </goals>

                    <configuration>

                             <targetURL>http://publishaemqa2.xxxxx.com:80/crx/packmgr/service.jsp</targetURL>

                    </configuration>

          </execution>

          </executions>

</plugin>

</plugins>

</pluginManagement>

</build>

</profile>

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

2 replies

Gaurav-Behl
Level 10
March 19, 2019

You'd need to invoke these profiles individually from CI/CD tool jenkins/bamboo or similar. Configure multiple build-targets in that job and pick a different profile for each target.

GK-007
GK-007Author
Level 9
March 19, 2019

I have created a separate profile and executed as part of Maven task in Bamboo but still, the code is not installing to other publish instance.

"mvn clean -PautoInstallPackage,autoInstallPackagePublish,autoInstallPackagePublish2 install" and supplied required author and publish instance details via variables.

i would be great if you have any sample piece of configuration for the same.

Thanks,

Kishore

arunpatidar
Community Advisor
Community Advisor
March 19, 2019

Hi,

Your POM looks ok though, what happened if you change the sequence of publishers execution tag. Is It deploying on 2nd one or still on 1st?

if you are deploying package on another publisher using new profile the you need to call .

mvn clean install -P autoInstallpackagePublish, autoInstallpackagePublish2

Check below if helps

https://www.albinsblog.com/2015/06/deploying-bundlespackages-to-different-env-maven-adobecq5-adobeaem.html#.XJE7jRNKjOR

Arun Patidar
GK-007
GK-007Author
Level 9
March 19, 2019

I have changed the execution sequence but still, it's picking the 1st one. I doubt id which we mentioned for other publish instance is not valid one so even though there is no syntax error but still it's not considering.

Thanks for Sharing the article, the article talks about if there is one author and publish instance ad i have asked a question to the author what could be the way in case of more than one publish instance.

GK-007
GK-007Author
Level 9
March 20, 2019

I tried same in my machine,I am able to deploy on both the servers.

when I change the sequence it start picking another one. I tested project using archetype 11 and 13

Are you sure you are changing correct POM? Can you share your maven deployment logs.

<profile>

   <id>autoInstallPackagePublish</id>

   <activation>

      <activeByDefault>false</activeByDefault>

   </activation>

   <build>

      <pluginManagement>

         <plugins>

            <plugin>

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

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

               <executions>

                  <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>

                  <execution>

                     <id>install-package-publish2</id>

                     <goals>

                        <goal>install</goal>

                     </goals>

                     <configuration>

                        <targetURL>http://${aem.publish.host}:4505/crx/packmgr/service.jsp</targetURL>

                     </configuration>

                  </execution>

               </executions>

            </plugin>

         </plugins>

      </pluginManagement>

   </build>

</profile>


I am changing in the parent pom only.Do we require to do any more changes to other POMs?

Can you please share the Maven command which you used to build and deploy the code?