Skip to content

Commit f4a6224

Browse files
committed
Use dedicated profile "cloud" for building secondary cloud artifacts
This profile is active by default for GH actions and release It also enables installation of the "cloud" content package to AEM
1 parent ba3c803 commit f4a6224

File tree

4 files changed

+179
-111
lines changed

4 files changed

+179
-111
lines changed

accesscontroltool-content-package/pom.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@
5252
<groupId>com.day.jcr.vault</groupId>
5353
<artifactId>content-package-maven-plugin</artifactId>
5454
</plugin>
55-
5655
</plugins>
5756
</build>
5857
</project>

accesscontroltool-oakindex-package/pom.xml

Lines changed: 67 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -40,44 +40,6 @@
4040
<packageType>content</packageType><!-- regular mutable content for AEM Classic -->
4141
</configuration>
4242
<executions>
43-
<execution>
44-
<id>cloud-generate-metadata</id>
45-
<goals>
46-
<goal>generate-metadata</goal>
47-
</goals>
48-
<configuration>
49-
<!-- application type for AEMaaCS, -->
50-
<packageType>application</packageType>
51-
<classifier>cloud</classifier>
52-
</configuration>
53-
</execution>
54-
<execution>
55-
<id>cloud-package</id>
56-
<goals>
57-
<goal>package</goal>
58-
</goals>
59-
<configuration>
60-
<classifier>cloud</classifier>
61-
</configuration>
62-
</execution>
63-
<execution>
64-
<id>cloud-validate-package</id>
65-
<goals>
66-
<goal>validate-package</goal>
67-
</goals>
68-
<configuration>
69-
<!-- workaround for https://issues.apache.org/jira/browse/JCRVLT-651 -->
70-
<packageFile>${project.build.directory}/${project.build.finalName}-cloud.zip</packageFile>
71-
<validatorsSettings>
72-
<jackrabbit-packagetype>
73-
<options>
74-
<!-- https://experienceleague.adobe.com/docs/experience-manager-cloud-service/content/operations/indexing.html?lang=en#project-configuration -->
75-
<immutableRootNodeNames>apps,libs,oak:index</immutableRootNodeNames>
76-
</options>
77-
</jackrabbit-packagetype>
78-
</validatorsSettings>
79-
</configuration>
80-
</execution>
8143
<execution>
8244
<id>default-validate-package</id>
8345
<goals>
@@ -97,9 +59,6 @@
9759
<plugin>
9860
<groupId>com.day.jcr.vault</groupId>
9961
<artifactId>content-package-maven-plugin</artifactId>
100-
<configuration>
101-
<targetURL>http://${crx.host}:${crx.port}/crx/packmgr/service.jsp</targetURL>
102-
</configuration>
10362
</plugin>
10463

10564
<plugin>
@@ -163,4 +122,71 @@
163122
</plugins>
164123
</pluginManagement>
165124
</build>
125+
<profiles>
126+
<profile>
127+
<id>cloud</id>
128+
<!-- automatically active on CI -->
129+
<activation>
130+
<property>
131+
<name>env.CI</name>
132+
</property>
133+
</activation>
134+
<build>
135+
<plugins>
136+
<plugin>
137+
<!-- optionally generate two packages: one for cloud (classifier "cloud") and one for classic (no classifier) -->
138+
<groupId>org.apache.jackrabbit</groupId>
139+
<artifactId>filevault-package-maven-plugin</artifactId>
140+
<executions>
141+
<execution>
142+
<id>cloud-generate-metadata</id>
143+
<goals>
144+
<goal>generate-metadata</goal>
145+
</goals>
146+
<configuration>
147+
<!-- application type for AEMaaCS, -->
148+
<packageType>application</packageType>
149+
<classifier>cloud</classifier>
150+
</configuration>
151+
</execution>
152+
<execution>
153+
<id>cloud-package</id>
154+
<goals>
155+
<goal>package</goal>
156+
</goals>
157+
<configuration>
158+
<classifier>cloud</classifier>
159+
</configuration>
160+
</execution>
161+
<execution>
162+
<id>cloud-validate-package</id>
163+
<goals>
164+
<goal>validate-package</goal>
165+
</goals>
166+
<configuration>
167+
<classifier>cloud</classifier>
168+
<skipPackageFile>true</skipPackageFile>
169+
<validatorsSettings>
170+
<jackrabbit-packagetype>
171+
<options>
172+
<!-- https://experienceleague.adobe.com/docs/experience-manager-cloud-service/content/operations/indexing.html?lang=en#project-configuration -->
173+
<immutableRootNodeNames>apps,libs,oak:index</immutableRootNodeNames>
174+
</options>
175+
</jackrabbit-packagetype>
176+
</validatorsSettings>
177+
</configuration>
178+
</execution>
179+
</executions>
180+
</plugin>
181+
<plugin>
182+
<groupId>com.adobe.aem</groupId>
183+
<artifactId>aemanalyser-maven-plugin</artifactId>
184+
<configuration>
185+
<classifier>cloud</classifier>
186+
</configuration>
187+
</plugin>
188+
</plugins>
189+
</build>
190+
</profile>
191+
</profiles>
166192
</project>

accesscontroltool-package/pom.xml

Lines changed: 92 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@
5555
<artifactId>aem-sdk-api</artifactId>
5656
<version>2021.5.5343.20210524T070738Z-210527</version>
5757
</dependency>
58-
5958
</dependencies>
6059
<build>
6160
<pluginManagement>
@@ -77,30 +76,7 @@
7776
</plugins>
7877
</pluginManagement>
7978
<plugins>
80-
<!-- for "cloud" package use repoinit instead of actool-content-package -->
81-
<plugin>
82-
<artifactId>maven-resources-plugin</artifactId>
83-
<executions>
84-
<execution>
85-
<id>copy-cloud-package-resources</id>
86-
<!-- here the phase you need -->
87-
<phase>process-resources</phase>
88-
<goals>
89-
<goal>copy-resources</goal>
90-
</goals>
91-
<configuration>
92-
<outputDirectory>${project.build.directory}/vault-work-cloud/jcr_root</outputDirectory>
93-
<resources>
94-
<resource>
95-
<directory>src/main/jcr_root-cloud</directory>
96-
<filtering>false</filtering>
97-
</resource>
98-
</resources>
99-
</configuration>
100-
</execution>
101-
</executions>
102-
</plugin>
103-
<!-- generate two packages: one for cloud (classifier "cloud") and one for classic (no classifier) -->
79+
<!-- optionally generate two packages: one for cloud (classifier "cloud") and one for classic (no classifier) -->
10480
<plugin>
10581
<groupId>org.apache.jackrabbit</groupId>
10682
<artifactId>filevault-package-maven-plugin</artifactId>
@@ -141,45 +117,6 @@
141117
<installHooks>org.apache.sling:org.apache.sling.installer.provider.installhook:1.1.0</installHooks>
142118
</configuration>
143119
</execution>
144-
<execution>
145-
<id>cloud-generate-metadata</id>
146-
<goals>
147-
<goal>generate-metadata</goal>
148-
</goals>
149-
<configuration>
150-
<!-- everything via embed, no subpackages, no accesscontroltool-content-package -->
151-
<embeddeds>
152-
<embedded>
153-
<artifactId>accesscontroltool-bundle</artifactId>
154-
</embedded>
155-
<embedded>
156-
<artifactId>accesscontroltool-apps-package</artifactId>
157-
</embedded>
158-
<embedded>
159-
<artifactId>accesscontroltool-startuphook-bundle</artifactId>
160-
<target>/apps/netcentric/actool/install/27</target>
161-
</embedded>
162-
</embeddeds>
163-
<classifier>cloud</classifier>
164-
</configuration>
165-
</execution>
166-
<execution>
167-
<id>cloud-package</id>
168-
<goals>
169-
<goal>package</goal>
170-
</goals>
171-
<configuration>
172-
<classifier>cloud</classifier>
173-
<failOnDuplicateEntries>false</failOnDuplicateEntries>
174-
</configuration>
175-
</execution>
176-
<execution>
177-
<id>default-validate-package</id>
178-
<configuration>
179-
<!-- validate both generated packages in one execution -->
180-
<classifier>cloud</classifier>
181-
</configuration>
182-
</execution>
183120
<execution>
184121
<id>default-analyze-classes</id>
185122
<phase>invalid</phase>
@@ -193,10 +130,98 @@
193130
<plugin>
194131
<groupId>com.adobe.aem</groupId>
195132
<artifactId>aemanalyser-maven-plugin</artifactId>
196-
<configuration>
197-
<classifier>cloud</classifier>
198-
</configuration>
199133
</plugin>
200134
</plugins>
201135
</build>
136+
<profiles>
137+
<profile>
138+
<id>cloud</id>
139+
<!-- automatically active on CI -->
140+
<activation>
141+
<property>
142+
<name>env.CI</name>
143+
</property>
144+
</activation>
145+
<build>
146+
<plugins>
147+
<!-- for "cloud" package use repoinit instead of actool-content-package -->
148+
<plugin>
149+
<artifactId>maven-resources-plugin</artifactId>
150+
<executions>
151+
<execution>
152+
<id>copy-cloud-package-resources</id>
153+
<!-- here the phase you need -->
154+
<phase>process-resources</phase>
155+
<goals>
156+
<goal>copy-resources</goal>
157+
</goals>
158+
<configuration>
159+
<outputDirectory>${project.build.directory}/vault-work-cloud/jcr_root</outputDirectory>
160+
<resources>
161+
<resource>
162+
<directory>src/main/jcr_root-cloud</directory>
163+
<filtering>false</filtering>
164+
</resource>
165+
</resources>
166+
</configuration>
167+
</execution>
168+
</executions>
169+
</plugin>
170+
<plugin>
171+
<!-- optionally generate two packages: one for cloud (classifier "cloud") and one for classic (no classifier) -->
172+
<groupId>org.apache.jackrabbit</groupId>
173+
<artifactId>filevault-package-maven-plugin</artifactId>
174+
<executions>
175+
<execution>
176+
<id>cloud-generate-metadata</id>
177+
<goals>
178+
<goal>generate-metadata</goal>
179+
</goals>
180+
<configuration>
181+
<!-- everything via embed, no subpackages, no accesscontroltool-content-package -->
182+
<embeddeds>
183+
<embedded>
184+
<artifactId>accesscontroltool-bundle</artifactId>
185+
</embedded>
186+
<embedded>
187+
<artifactId>accesscontroltool-apps-package</artifactId>
188+
</embedded>
189+
<embedded>
190+
<artifactId>accesscontroltool-startuphook-bundle</artifactId>
191+
<target>/apps/netcentric/actool/install/27</target>
192+
</embedded>
193+
</embeddeds>
194+
<classifier>cloud</classifier>
195+
</configuration>
196+
</execution>
197+
<execution>
198+
<id>cloud-package</id>
199+
<goals>
200+
<goal>package</goal>
201+
</goals>
202+
<configuration>
203+
<classifier>cloud</classifier>
204+
<failOnDuplicateEntries>false</failOnDuplicateEntries>
205+
</configuration>
206+
</execution>
207+
<execution>
208+
<id>default-validate-package</id>
209+
<configuration>
210+
<!-- validate both generated packages in one execution -->
211+
<classifier>cloud</classifier>
212+
</configuration>
213+
</execution>
214+
</executions>
215+
</plugin>
216+
<plugin>
217+
<groupId>com.adobe.aem</groupId>
218+
<artifactId>aemanalyser-maven-plugin</artifactId>
219+
<configuration>
220+
<classifier>cloud</classifier>
221+
</configuration>
222+
</plugin>
223+
</plugins>
224+
</build>
225+
</profile>
226+
</profiles>
202227
</project>

pom.xml

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@
8888
<maven.compiler.release>8</maven.compiler.release>
8989
<mockito.version>4.8.0</mockito.version>
9090
<junit.version>5.10.0</junit.version>
91+
<!-- default content package file to install on AEM -->
92+
<contentPackageFile>${project.build.directory}/${project.build.finalName}.zip</contentPackageFile>
9193
</properties>
9294

9395
<modules>
@@ -301,7 +303,7 @@
301303
<plugin>
302304
<groupId>org.apache.jackrabbit</groupId>
303305
<artifactId>filevault-package-maven-plugin</artifactId>
304-
<version>1.3.0</version>
306+
<version>1.3.6</version>
305307
<extensions>true</extensions>
306308
<configuration>
307309
<group>Netcentric</group>
@@ -389,6 +391,8 @@
389391
<failOnError>true</failOnError>
390392
<userId>${crx.username}</userId>
391393
<password>${crx.password}</password>
394+
<!-- this should either point to the primary artifact file or a secondary one. There is no direct "classifier" support in this maven plugin -->
395+
<packageFile>${contentPackageFile}</packageFile>
392396
</configuration>
393397
</plugin>
394398
<plugin>
@@ -409,7 +413,7 @@
409413
<artifactId>maven-release-plugin</artifactId>
410414
<version>3.0.0-M6</version>
411415
<configuration>
412-
<releaseProfiles>release</releaseProfiles>
416+
<releaseProfiles>release,cloud</releaseProfiles>
413417
<autoVersionSubmodules>true</autoVersionSubmodules>
414418
<tagNameFormat>@{project.version}</tagNameFormat>
415419
<!-- skip rebuilding the release with GitHub actions (https://github.blog/changelog/2021-02-08-github-actions-skip-pull-request-and-push-workflows-with-skip-ci/) -->
@@ -742,6 +746,20 @@
742746
</plugins>
743747
</build>
744748
</profile>
749+
<profile>
750+
<!-- build packages for cloud (as secondary artifacts with classifier "cloud") and install those to AEM instead when leveraging content-package-maven-plugin -->
751+
<id>cloud</id>
752+
<!-- automatically active on CI -->
753+
<activation>
754+
<property>
755+
<name>env.CI</name>
756+
</property>
757+
</activation>
758+
<properties>
759+
<!-- install package with "cloud" classifier to AEM -->
760+
<contentPackageFile>${project.build.directory}/${project.build.finalName}-cloud.zip</contentPackageFile>
761+
</properties>
762+
</profile>
745763
</profiles>
746764

747765
</project>

0 commit comments

Comments
 (0)