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>
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.
Views
Replies
Total Likes
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
Views
Replies
Total Likes
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
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.
Views
Replies
Total Likes
If you want to proceed with this approach, then try -P "profile1,profile2" within quotes
Views
Replies
Total Likes
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>
Views
Replies
Total Likes
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?
Views
Replies
Total Likes
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
Views
Replies
Total Likes
Hi,
Changes require in parent POM only.
I ran below command from Eclipse.
mvn clean install -P autoInstallpackagePublish
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies