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

Avatar

Avatar
Validate 100
Level 6
GK-AEM
Level 6

Likes

41 likes

Total Posts

482 posts

Correct reply

32 solutions
Top badges earned
Validate 100
Validate 50
Validate 25
Validate 10
Validate 1
View profile

Avatar
Validate 100
Level 6
GK-AEM
Level 6

Likes

41 likes

Total Posts

482 posts

Correct reply

32 solutions
Top badges earned
Validate 100
Validate 50
Validate 25
Validate 10
Validate 1
View profile
GK-AEM
Level 6

19-03-2019

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>

Replies

Avatar

Avatar
Boost 250
MVP
Gaurav-Behl
MVP

Likes

250 likes

Total Posts

1,147 posts

Correct reply

283 solutions
Top badges earned
Boost 250
Establish
Give back 300
Give Back 50
Give Back 5
View profile

Avatar
Boost 250
MVP
Gaurav-Behl
MVP

Likes

250 likes

Total Posts

1,147 posts

Correct reply

283 solutions
Top badges earned
Boost 250
Establish
Give back 300
Give Back 50
Give Back 5
View profile
Gaurav-Behl
MVP

19-03-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.

Avatar

Avatar
Validate 100
Level 6
GK-AEM
Level 6

Likes

41 likes

Total Posts

482 posts

Correct reply

32 solutions
Top badges earned
Validate 100
Validate 50
Validate 25
Validate 10
Validate 1
View profile

Avatar
Validate 100
Level 6
GK-AEM
Level 6

Likes

41 likes

Total Posts

482 posts

Correct reply

32 solutions
Top badges earned
Validate 100
Validate 50
Validate 25
Validate 10
Validate 1
View profile
GK-AEM
Level 6

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

Avatar

Avatar
Coach
MVP
Arun_Patidar
MVP

Likes

1,444 likes

Total Posts

3,322 posts

Correct reply

941 solutions
Top badges earned
Coach
Contributor 2
Ignite 10
Give Back 700
Boost 1000
View profile

Avatar
Coach
MVP
Arun_Patidar
MVP

Likes

1,444 likes

Total Posts

3,322 posts

Correct reply

941 solutions
Top badges earned
Coach
Contributor 2
Ignite 10
Give Back 700
Boost 1000
View profile
Arun_Patidar
MVP

19-03-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-adobeae...

Avatar

Avatar
Validate 100
Level 6
GK-AEM
Level 6

Likes

41 likes

Total Posts

482 posts

Correct reply

32 solutions
Top badges earned
Validate 100
Validate 50
Validate 25
Validate 10
Validate 1
View profile

Avatar
Validate 100
Level 6
GK-AEM
Level 6

Likes

41 likes

Total Posts

482 posts

Correct reply

32 solutions
Top badges earned
Validate 100
Validate 50
Validate 25
Validate 10
Validate 1
View profile
GK-AEM
Level 6

19-03-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.

Avatar

Avatar
Boost 250
MVP
Gaurav-Behl
MVP

Likes

250 likes

Total Posts

1,147 posts

Correct reply

283 solutions
Top badges earned
Boost 250
Establish
Give back 300
Give Back 50
Give Back 5
View profile

Avatar
Boost 250
MVP
Gaurav-Behl
MVP

Likes

250 likes

Total Posts

1,147 posts

Correct reply

283 solutions
Top badges earned
Boost 250
Establish
Give back 300
Give Back 50
Give Back 5
View profile
Gaurav-Behl
MVP

19-03-2019

If you want to proceed with this approach, then try -P "profile1,profile2" within quotes

Avatar

Avatar
Coach
MVP
Arun_Patidar
MVP

Likes

1,444 likes

Total Posts

3,322 posts

Correct reply

941 solutions
Top badges earned
Coach
Contributor 2
Ignite 10
Give Back 700
Boost 1000
View profile

Avatar
Coach
MVP
Arun_Patidar
MVP

Likes

1,444 likes

Total Posts

3,322 posts

Correct reply

941 solutions
Top badges earned
Coach
Contributor 2
Ignite 10
Give Back 700
Boost 1000
View profile
Arun_Patidar
MVP

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

Avatar

Avatar
Validate 100
Level 6
GK-AEM
Level 6

Likes

41 likes

Total Posts

482 posts

Correct reply

32 solutions
Top badges earned
Validate 100
Validate 50
Validate 25
Validate 10
Validate 1
View profile

Avatar
Validate 100
Level 6
GK-AEM
Level 6

Likes

41 likes

Total Posts

482 posts

Correct reply

32 solutions
Top badges earned
Validate 100
Validate 50
Validate 25
Validate 10
Validate 1
View profile
GK-AEM
Level 6

19-03-2019

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?

Avatar

Avatar
Springboard
Level 7
Prince_Shivhare
Level 7

Likes

123 likes

Total Posts

407 posts

Correct reply

65 solutions
Top badges earned
Springboard
Establish
Give Back 100
Boost 100
Validate 1
View profile

Avatar
Springboard
Level 7
Prince_Shivhare
Level 7

Likes

123 likes

Total Posts

407 posts

Correct reply

65 solutions
Top badges earned
Springboard
Establish
Give Back 100
Boost 100
Validate 1
View profile
Prince_Shivhare
Level 7

19-03-2019

No, that should be in parent pom only.

and command depends on your profile Id in pom file.

in your case, it should be mvn clean install -PautoInstallPackagePublish

Avatar

Avatar
Coach
MVP
Arun_Patidar
MVP

Likes

1,444 likes

Total Posts

3,322 posts

Correct reply

941 solutions
Top badges earned
Coach
Contributor 2
Ignite 10
Give Back 700
Boost 1000
View profile

Avatar
Coach
MVP
Arun_Patidar
MVP

Likes

1,444 likes

Total Posts

3,322 posts

Correct reply

941 solutions
Top badges earned
Coach
Contributor 2
Ignite 10
Give Back 700
Boost 1000
View profile
Arun_Patidar
MVP

20-03-2019

Hi,

Changes require in parent POM only.

I ran below command from Eclipse.

mvn clean install -P autoInstallpackagePublish