Skip to content

Commit 8c98dd5

Browse files
committed
Merge branch 'develop'
2 parents 7b2e156 + 657cfe2 commit 8c98dd5

File tree

6 files changed

+67
-18
lines changed

6 files changed

+67
-18
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<img src="https://wcm.io/images/[email protected]"/> cq-maven-plugin
22
======
33
[![Build](https://github.com/wcm-io/io.wcm.maven.plugins.cq-maven-plugin/workflows/Build/badge.svg?branch=develop)](https://github.com/wcm-io/io.wcm.maven.plugins.cq-maven-plugin/actions?query=workflow%3ABuild+branch%3Adevelop)
4-
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/io.wcm.maven.plugins/cq-maven-plugin/badge.svg)](https://maven-badges.herokuapp.com/maven-central/io.wcm.maven.plugins/cq-maven-plugin)
4+
[![Maven Central](https://img.shields.io/maven-central/v/io.wcm.maven.plugins/cq-maven-plugin)](https://repo1.maven.org/maven2/io/wcm/maven/plugins/cq-maven-plugin)
55
[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=wcm-io_io.wcm.maven.plugins.cq-maven-plugin&metric=coverage)](https://sonarcloud.io/summary/new_code?id=wcm-io_io.wcm.maven.plugins.cq-maven-plugin)
66

77
Convenience maven plugin for working with CQ/AEM maven projects.

changes.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@
2323
xsi:schemaLocation="http://maven.apache.org/changes/1.0.0 http://maven.apache.org/plugins/maven-changes-plugin/xsd/changes-1.0.0.xsd">
2424
<body>
2525

26+
<release version="1.2.0" date="2022-08-29">
27+
<action type="update" dev="sseifert">
28+
Use "sling:install-file" instead of "sling:install" goal to be compatbile with sling-maven-plugin 3.x.
29+
</action>
30+
</release>
31+
2632
<release version="1.1.4" date="2022-01-27">
2733
<action type="update" dev="sseifert">
2834
Declare Maven core dependencies as provided.

pom.xml

Lines changed: 48 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@
2525
<parent>
2626
<groupId>io.wcm.maven</groupId>
2727
<artifactId>io.wcm.maven.parent</artifactId>
28-
<version>2.0.0</version>
28+
<version>2.0.4</version>
2929
<relativePath />
3030
</parent>
3131

3232
<groupId>io.wcm.maven.plugins</groupId>
3333
<artifactId>cq-maven-plugin</artifactId>
34-
<version>1.1.4</version>
34+
<version>1.2.0</version>
3535
<packaging>maven-plugin</packaging>
3636

3737
<name>CQ Maven Plugin</name>
@@ -50,7 +50,7 @@
5050
<maven.version>3.5.0</maven.version>
5151

5252
<!-- Enable reproducible builds -->
53-
<project.build.outputTimestamp>2022-01-27T09:04:49Z</project.build.outputTimestamp>
53+
<project.build.outputTimestamp>2022-08-29T10:37:37Z</project.build.outputTimestamp>
5454

5555
<!-- Enable recording of coverage during execution of maven-invoker-plugin -->
5656
<jacoco.propertyName>invoker.mavenOpts</jacoco.propertyName>
@@ -83,14 +83,14 @@
8383
<dependency>
8484
<groupId>org.apache.maven.shared</groupId>
8585
<artifactId>maven-invoker</artifactId>
86-
<version>3.1.0</version>
86+
<version>3.2.0</version>
8787
<scope>compile</scope>
8888
</dependency>
8989

9090
<dependency>
9191
<groupId>org.apache.commons</groupId>
9292
<artifactId>commons-lang3</artifactId>
93-
<version>3.12.0</version>
93+
<version>3.12.0</version>
9494
<scope>compile</scope>
9595
</dependency>
9696
</dependencies>
@@ -121,35 +121,74 @@
121121
</executions>
122122
</plugin>
123123

124-
<plugin>
124+
<!-- Merge Jacoco results from unit tests and integration tests -->
125+
<plugin>
125126
<groupId>org.jacoco</groupId>
126127
<artifactId>jacoco-maven-plugin</artifactId>
127128
<executions>
128129
<execution>
130+
<id>before-unit-test-execution</id>
129131
<goals>
130132
<goal>prepare-agent</goal>
133+
</goals>
134+
<configuration>
135+
<destFile>${project.build.directory}/jacoco-output/jacoco-unit-tests.exec</destFile>
136+
<propertyName>surefire.jacoco.args</propertyName>
137+
</configuration>
138+
</execution>
139+
<execution>
140+
<id>before-integration-test-execution</id>
141+
<goals>
131142
<goal>prepare-agent-integration</goal>
132-
<goal>report</goal>
133-
<goal>report-integration</goal>
143+
</goals>
144+
<configuration>
145+
<destFile>${project.build.directory}/jacoco-output/jacoco-integration-tests.exec</destFile>
146+
<propertyName>invoker.jacoco.args</propertyName>
147+
</configuration>
148+
</execution>
149+
<execution>
150+
<id>merge-unit-and-integration</id>
151+
<phase>post-integration-test</phase>
152+
<goals>
153+
<goal>merge</goal>
134154
</goals>
155+
<configuration>
156+
<fileSets>
157+
<fileSet>
158+
<directory>${project.build.directory}/jacoco-output</directory>
159+
<includes>
160+
<include>*.exec</include>
161+
</includes>
162+
</fileSet>
163+
</fileSets>
164+
</configuration>
135165
</execution>
136166
</executions>
137167
</plugin>
138168

169+
<plugin>
170+
<groupId>org.apache.maven.plugins</groupId>
171+
<artifactId>maven-surefire-plugin</artifactId>
172+
<configuration>
173+
<argLine>${surefire.jacoco.args}</argLine>
174+
</configuration>
175+
</plugin>
176+
139177
<plugin>
140178
<groupId>org.apache.maven.plugins</groupId>
141179
<artifactId>maven-invoker-plugin</artifactId>
142180
<configuration>
143181
<projectsDirectory>src/it</projectsDirectory>
144182
<cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
145183
<pomIncludes>
146-
<pomInclude>**/pom.xml</pomInclude>
184+
<pomInclude>*/pom.xml</pomInclude>
147185
</pomIncludes>
148186
<postBuildHookScript>verify</postBuildHookScript>
149187
<streamLogsOnFailures>true</streamLogsOnFailures>
150188
<extraArtifacts>
151189
<extraArtifact>org.jacoco:org.jacoco.agent:${jacoco-maven-plugin.version}:jar:runtime</extraArtifact>
152190
</extraArtifacts>
191+
<mavenOpts>${invoker.jacoco.args}</mavenOpts>
153192
</configuration>
154193
<executions>
155194
<execution>

src/it/bundle-install/pom.xml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
<parent>
2626
<groupId>io.wcm.maven</groupId>
2727
<artifactId>io.wcm.maven.aem-global-parent</artifactId>
28-
<version>2.0.0</version>
28+
<version>2.0.14</version>
2929
<relativePath/>
3030
</parent>
3131

@@ -37,6 +37,10 @@
3737
<!-- Java version -->
3838
<java.version>1.8</java.version>
3939
<build.compiler.release>8</build.compiler.release>
40+
41+
<!-- Test against 3.x version of sling-maven-plugin (can be removed when updated to aem-global-parent 2.0.16 or higher) -->
42+
<sling.sling-maven-plugin.version>3.0.2</sling.sling-maven-plugin.version>
43+
4044
</properties>
4145

4246
<build>

src/main/java/io/wcm/maven/plugins/cq/InstallMojo.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,8 @@ private void executeSlingPluginDirectly() throws MojoExecutionException {
154154
try {
155155
PluginDescriptor pluginDescriptor = pluginManager.getPluginDescriptor(plugin,
156156
project.getRemotePluginRepositories(), session.getRepositorySession());
157-
MojoDescriptor mojoDescriptor = pluginDescriptor.getMojo("install");
158-
MojoExecution mojoExecution = new MojoExecution(pluginDescriptor.getMojo("install"));
157+
MojoDescriptor mojoDescriptor = pluginDescriptor.getMojo("install-file");
158+
MojoExecution mojoExecution = new MojoExecution(pluginDescriptor.getMojo("install-file"));
159159

160160
Xpp3Dom config = convertConfiguration(mojoDescriptor.getMojoConfiguration());
161161
config.getChild("slingUrl").setValue(this.slingConsoleUrl);
@@ -201,8 +201,8 @@ private void executeWithMavenInvoker(String goal) throws MojoExecutionException
201201
invocationRequest.setProperties(session.getUserProperties());
202202
invocationRequest.setProfiles(settings.getActiveProfiles());
203203

204+
setupInvokerLogger(invocationRequest);
204205
Invoker invoker = new DefaultInvoker();
205-
setupInvokerLogger(invoker);
206206

207207
try {
208208
InvocationResult invocationResult = invoker.execute(invocationRequest);
@@ -221,11 +221,11 @@ private void executeWithMavenInvoker(String goal) throws MojoExecutionException
221221

222222
/**
223223
* Mirror maven execution log output to current maven logger.
224-
* @param invoker Invoker
224+
* @param request Invocation request
225225
*/
226-
private void setupInvokerLogger(Invoker invoker) {
226+
private void setupInvokerLogger(InvocationRequest request) {
227227
Log log = getLog();
228-
invoker.setOutputHandler(new InvocationOutputHandler() {
228+
request.setOutputHandler(new InvocationOutputHandler() {
229229
@Override
230230
public void consumeLine(String line) {
231231
if (StringUtils.startsWith(line, "[ERROR] ")) {

src/site/markdown/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ About CQ Maven Plugin
33

44
Convenience maven plugin for working with CQ/AEM maven projects.
55

6-
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/io.wcm.maven.plugins/cq-maven-plugin/badge.svg)](https://maven-badges.herokuapp.com/maven-central/io.wcm.maven.plugins/cq-maven-plugin)
6+
[![Maven Central](https://img.shields.io/maven-central/v/io.wcm.maven.plugins/cq-maven-plugin)](https://repo1.maven.org/maven2/io/wcm/maven/plugins/cq-maven-plugin)
77

88

99
### Documentation

0 commit comments

Comments
 (0)