Skip to content

Commit 39604d2

Browse files
committed
convert example project into maven integration test
1 parent 51a1e61 commit 39604d2

21 files changed

Lines changed: 91 additions & 11 deletions

.github/workflows/maven-build.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,3 @@ jobs:
4242
sonar-run-on-java-version: 11
4343
sonar-token: ${{ secrets.SONAR_TOKEN }}
4444
github-token: ${{ secrets.GITHUB_TOKEN }}
45-
46-
- name: Build and verify example
47-
run: ./mvnw -s ./.maven-settings.xml -Pcontinuous-integration -B -U clean verify -f example

pom.xml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,6 @@
5252
<module>conga-aem-plugin</module>
5353
<module>tooling/conga-aem-maven-plugin</module>
5454
<module>tooling/conga-aem-crypto-cli</module>
55-
<!-- This is not included in main build due to conga-maven-plugin plugin dependency -->
56-
<!--module>example</module-->
5755
</modules>
5856

5957
<build>

src/site/markdown/usage.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,8 @@ For basic CONGA usage see [CONGA documentation][conga-usage].
55

66
### CONGA AEM Plugin
77

8-
An example using the CONGA AEM plugin-specific features is in this GIT repository:<br/>
9-
https://github.com/wcm-io-devops/conga-aem-plugin
10-
11-
In a subdirectory `example`.
8+
An example using the CONGA AEM plugin-specific features:<br/>
9+
https://github.com/wcm-io-devops/conga-aem-plugin/tree/develop/tooling/conga-aem-maven-plugin/src/it/example
1210

1311

1412
### CONGA Maven AEM Plugin

tooling/conga-aem-maven-plugin/pom.xml

Lines changed: 87 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,12 @@
3838
<description>wcm.io DevOps CONGA - CONfiguration GenerAtor Maven Plugin for AEM</description>
3939

4040
<properties>
41-
<maven.version>3.0.5</maven.version>
41+
<maven.version>3.3.9</maven.version>
4242
<site.url.module.prefix>tooling/conga-aem-maven-plugin</site.url.module.prefix>
43+
44+
<!-- Enable recording of coverage during execution of maven-invoker-plugin -->
45+
<jacoco.propertyName>invoker.mavenOpts</jacoco.propertyName>
46+
<jacoco.includes>org.jacoco.maven.*</jacoco.includes>
4347
</properties>
4448

4549
<prerequisites>
@@ -175,6 +179,88 @@
175179
</executions>
176180
</plugin>
177181

182+
<!-- Merge Jacoco results from unit tests and integration tests -->
183+
<plugin>
184+
<groupId>org.jacoco</groupId>
185+
<artifactId>jacoco-maven-plugin</artifactId>
186+
<executions>
187+
<execution>
188+
<id>before-unit-test-execution</id>
189+
<goals>
190+
<goal>prepare-agent</goal>
191+
</goals>
192+
<configuration>
193+
<destFile>${project.build.directory}/jacoco-output/jacoco-unit-tests.exec</destFile>
194+
<propertyName>surefire.jacoco.args</propertyName>
195+
</configuration>
196+
</execution>
197+
<execution>
198+
<id>before-integration-test-execution</id>
199+
<goals>
200+
<goal>prepare-agent-integration</goal>
201+
</goals>
202+
<configuration>
203+
<destFile>${project.build.directory}/jacoco-output/jacoco-integration-tests.exec</destFile>
204+
<propertyName>invoker.jacoco.args</propertyName>
205+
</configuration>
206+
</execution>
207+
<execution>
208+
<id>merge-unit-and-integration</id>
209+
<phase>post-integration-test</phase>
210+
<goals>
211+
<goal>merge</goal>
212+
</goals>
213+
<configuration>
214+
<fileSets>
215+
<fileSet>
216+
<directory>${project.build.directory}/jacoco-output</directory>
217+
<includes>
218+
<include>*.exec</include>
219+
</includes>
220+
</fileSet>
221+
</fileSets>
222+
</configuration>
223+
</execution>
224+
</executions>
225+
</plugin>
226+
227+
<plugin>
228+
<groupId>org.apache.maven.plugins</groupId>
229+
<artifactId>maven-surefire-plugin</artifactId>
230+
<configuration>
231+
<argLine>${surefire.jacoco.args}</argLine>
232+
</configuration>
233+
</plugin>
234+
235+
<plugin>
236+
<groupId>org.apache.maven.plugins</groupId>
237+
<artifactId>maven-invoker-plugin</artifactId>
238+
<version>3.2.2</version>
239+
<configuration>
240+
<projectsDirectory>src/it</projectsDirectory>
241+
<cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
242+
<pomIncludes>
243+
<pomInclude>*/pom.xml</pomInclude>
244+
</pomIncludes>
245+
<postBuildHookScript>verify</postBuildHookScript>
246+
<streamLogsOnFailures>true</streamLogsOnFailures>
247+
<extraArtifacts>
248+
<extraArtifact>org.jacoco:org.jacoco.agent:${jacoco-maven-plugin.version}:jar:runtime</extraArtifact>
249+
</extraArtifacts>
250+
<mavenOpts>${invoker.jacoco.args}</mavenOpts>
251+
</configuration>
252+
<executions>
253+
<execution>
254+
<id>integration-test</id>
255+
<goals>
256+
<goal>install</goal>
257+
<goal>integration-test</goal>
258+
<goal>verify</goal>
259+
</goals>
260+
</execution>
261+
</executions>
262+
</plugin>
263+
178264
</plugins>
179265
<pluginManagement>
180266
<plugins>

example/README.md renamed to tooling/conga-aem-maven-plugin/src/it/example/README.md

File renamed without changes.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
invoker.goals = clean verify

example/pom.xml renamed to tooling/conga-aem-maven-plugin/src/it/example/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
<dependency>
6666
<groupId>io.wcm.devops.conga.plugins</groupId>
6767
<artifactId>io.wcm.devops.conga.plugins.aem</artifactId>
68-
<version>2.16.3-SNAPSHOT</version>
68+
<version>@project.version@</version>
6969
</dependency>
7070

7171
</dependencies>

example/src/main/environments/prod.yaml renamed to tooling/conga-aem-maven-plugin/src/it/example/src/main/environments/prod.yaml

File renamed without changes.

example/src/main/resources/crypto/master renamed to tooling/conga-aem-maven-plugin/src/it/example/src/main/resources/crypto/master

File renamed without changes.

example/src/main/resources/wcm-io-package-thumbnail.png renamed to tooling/conga-aem-maven-plugin/src/it/example/src/main/resources/wcm-io-package-thumbnail.png

File renamed without changes.

0 commit comments

Comments
 (0)