Skip to content

Commit 0980890

Browse files
committed
Merge branch 'develop' into master
2 parents cb13614 + 6ac1947 commit 0980890

9 files changed

Lines changed: 87 additions & 78 deletions

File tree

changes.xml

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,25 @@
2323
xsi:schemaLocation="http://maven.apache.org/changes/1.0.0 https://maven.apache.org/plugins/maven-changes-plugin/xsd/changes-1.0.0.xsd">
2424
<body>
2525

26-
<release version="1.15.0" date="2021-09-20">
26+
<release version="2.16.0" date="2021-12-13">
27+
<action type="add" dev="sseifert">
28+
conga-aem-maven-plugin: Add support for IMS/Auth 2 authentication for AEMaaCS (via oauth2AccessToken).
29+
</action>
30+
<action type="add" dev="sseifert" issue="WTOOL-71">
31+
conga-aem-maven-plugin: New configuration parameter packageManagerOutputLogLevel to allow to change log level for package manager output (which may get huge for big packages) from INFO to DEBUG.
32+
</action>
33+
<action type="add" dev="sseifert">
34+
conga-aem-maven-plugin: Flag replicate allows to replicate a package to publish instance after uploading it to author instance.
35+
</action>
36+
<action type="add" dev="sseifert">
37+
conga-aem-maven-plugin: Add jcl-over-slf4j bridge to be able to capture HTTP client debug messages with Maven debug logging.
38+
</action>
39+
<action type="update" dev="sseifert">
40+
Content Package Validator: Update to filevault-package-maven-plugin 1.2.2.
41+
</action>
42+
</release>
43+
44+
<release version="2.15.0" date="2021-09-20">
2745
<action type="add" dev="sseifert">
2846
Content Package Validator: Load default node types for validation from biz.netcentric.aem:aem-nodetypes and io.wcm.tooling.nodetypes:io.wcm.tooling.nodetypes.wcmio.
2947
</action>
@@ -33,6 +51,9 @@
3351
<action type="update" dev="sseifert">
3452
conga-aem-maven-plugin:cloudmanager-all-package: Ensure dependencies of sub packages are managed as well.
3553
</action>
54+
<action type="update" dev="sseifert"><![CDATA[
55+
<i>PLEASE NOTE:</i> The release number was accidentially updated to 2.x - but the release is 100% backward compatible to the 1.x releases.
56+
]]></action>
3657
</release>
3758

3859
<release version="1.14.6" date="2021-06-27">

conga-aem-plugin/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@
2525
<parent>
2626
<groupId>io.wcm.devops.conga.plugins</groupId>
2727
<artifactId>io.wcm.devops.conga.plugins.aem.parent</artifactId>
28-
<version>2.15.0</version>
28+
<version>2.16.0</version>
2929
<relativePath>../parent/pom.xml</relativePath>
3030
</parent>
3131

3232
<groupId>io.wcm.devops.conga.plugins</groupId>
3333
<artifactId>io.wcm.devops.conga.plugins.aem</artifactId>
34-
<version>2.15.0</version>
34+
<version>2.16.0</version>
3535
<packaging>jar</packaging>
3636

3737
<name>CONGA AEM Plugin</name>

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>1.14.7-SNAPSHOT</version>
68+
<version>2.15.1-SNAPSHOT</version>
6969
</dependency>
7070

7171
</dependencies>

parent/pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131

3232
<groupId>io.wcm.devops.conga.plugins</groupId>
3333
<artifactId>io.wcm.devops.conga.plugins.aem.parent</artifactId>
34-
<version>2.15.0</version>
34+
<version>2.16.0</version>
3535
<packaging>pom</packaging>
3636

3737
<name>CONGA AEM Plugin</name>
@@ -75,7 +75,7 @@
7575
<dependency>
7676
<groupId>io.wcm.tooling.commons</groupId>
7777
<artifactId>io.wcm.tooling.commons.crx-packmgr-helper</artifactId>
78-
<version>1.7.4</version>
78+
<version>2.0.0</version>
7979
</dependency>
8080

8181
<dependency>
@@ -87,7 +87,7 @@
8787
<dependency>
8888
<groupId>org.apache.jackrabbit</groupId>
8989
<artifactId>filevault-package-maven-plugin</artifactId>
90-
<version>1.1.8</version>
90+
<version>1.2.2</version>
9191
</dependency>
9292

9393
<dependency>

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@
2323
<parent>
2424
<groupId>io.wcm.devops.conga.plugins</groupId>
2525
<artifactId>io.wcm.devops.conga.plugins.aem.parent</artifactId>
26-
<version>2.15.0</version>
26+
<version>2.16.0</version>
2727
<relativePath>parent/pom.xml</relativePath>
2828
</parent>
2929

3030
<groupId>io.wcm.devops.conga.plugins</groupId>
3131
<artifactId>io.wcm.devops.conga.plugins.aem.root</artifactId>
32-
<version>2.15.0</version>
32+
<version>2.16.0</version>
3333
<packaging>pom</packaging>
3434

3535
<name>CONGA AEM Plugin</name>

tooling/conga-aem-crypto-cli/pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@
2525
<parent>
2626
<groupId>io.wcm.devops.conga.plugins</groupId>
2727
<artifactId>io.wcm.devops.conga.plugins.aem.parent</artifactId>
28-
<version>2.15.0</version>
28+
<version>2.16.0</version>
2929
<relativePath>../../parent/pom.xml</relativePath>
3030
</parent>
3131

3232
<groupId>io.wcm.devops.conga.plugins</groupId>
3333
<artifactId>conga-aem-crypto-cli</artifactId>
3434
<packaging>jar</packaging>
35-
<version>2.15.0</version>
35+
<version>2.16.0</version>
3636

3737
<name>CONGA AEM Crypto Command Line Interface</name>
3838
<description>Command line tool to generate Crypto keys for AEM.</description>
@@ -42,7 +42,7 @@
4242
<dependency>
4343
<groupId>io.wcm.devops.conga.plugins</groupId>
4444
<artifactId>io.wcm.devops.conga.plugins.aem</artifactId>
45-
<version>2.15.0</version>
45+
<version>2.16.0</version>
4646
<scope>compile</scope>
4747
<exclusions>
4848
<!-- Exclude all deps - only crypto util classes are used -->

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

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@
2525
<parent>
2626
<groupId>io.wcm.devops.conga.plugins</groupId>
2727
<artifactId>io.wcm.devops.conga.plugins.aem.parent</artifactId>
28-
<version>2.15.0</version>
28+
<version>2.16.0</version>
2929
<relativePath>../../parent/pom.xml</relativePath>
3030
</parent>
3131

3232
<groupId>io.wcm.devops.conga.plugins</groupId>
3333
<artifactId>conga-aem-maven-plugin</artifactId>
3434
<packaging>maven-plugin</packaging>
35-
<version>2.15.0</version>
35+
<version>2.16.0</version>
3636

3737
<name>CONGA AEM Maven Plugin</name>
3838
<description>wcm.io DevOps CONGA - CONfiguration GenerAtor Maven Plugin for AEM</description>
@@ -56,7 +56,7 @@
5656
<dependency>
5757
<groupId>io.wcm.devops.conga.plugins</groupId>
5858
<artifactId>io.wcm.devops.conga.plugins.aem</artifactId>
59-
<version>2.15.0</version>
59+
<version>2.16.0</version>
6060
<scope>compile</scope>
6161
</dependency>
6262
<dependency>
@@ -106,6 +106,13 @@
106106
<artifactId>io.wcm.tooling.commons.crx-packmgr-helper</artifactId>
107107
<scope>compile</scope>
108108
</dependency>
109+
<!-- Add logging bridge to capture debug logging from Apache HTTP client 4 -->
110+
<dependency>
111+
<groupId>org.slf4j</groupId>
112+
<artifactId>jcl-over-slf4j</artifactId>
113+
<version>1.7.32</version>
114+
<scope>compile</scope>
115+
</dependency>
109116

110117
<dependency>
111118
<groupId>org.slf4j</groupId>

tooling/conga-aem-maven-plugin/src/main/java/io/wcm/devops/conga/plugins/aem/maven/AbstractContentPackageMojo.java

Lines changed: 30 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232

3333
import com.google.common.collect.ImmutableList;
3434

35-
import io.wcm.tooling.commons.packmgr.Logger;
3635
import io.wcm.tooling.commons.packmgr.PackageManagerProperties;
3736
import io.wcm.tooling.commons.packmgr.install.VendorInstallerFactory;
3837

@@ -57,15 +56,22 @@ abstract class AbstractContentPackageMojo extends AbstractMojo {
5756
/**
5857
* The user name to authenticate as against the remote CRX system (package manager).
5958
*/
60-
@Parameter(property = "vault.userId", required = true, defaultValue = "admin")
59+
@Parameter(property = "vault.userId", defaultValue = "admin")
6160
private String userId;
6261

6362
/**
6463
* The password to authenticate against the remote CRX system (package manager).
6564
*/
66-
@Parameter(property = "vault.password", required = true, defaultValue = "admin")
65+
@Parameter(property = "vault.password", defaultValue = "admin")
6766
private String password;
6867

68+
/**
69+
* OAuth 2 access token to authenticate against the remote CRX system (package manager).
70+
* If this is configured, username and password are ignored.
71+
*/
72+
@Parameter(property = "vault.oauth2AccessToken")
73+
private String oauth2AccessToken;
74+
6975
/**
7076
* The user name to authenticate as against the remote CRX system (Felix console).
7177
* Defaults to the value from <code>userId</code>.
@@ -78,7 +84,15 @@ abstract class AbstractContentPackageMojo extends AbstractMojo {
7884
* Defaults to the value from <code>password</code>.
7985
*/
8086
@Parameter(property = "console.password")
87+
8188
private String consolePassword;
89+
/**
90+
* OAuth 2 access token to authenticate against the remote CRX system (Felix console).
91+
* If this is configured, username and password are ignored.
92+
* Defaults to value from <code>authenticationBearerToken</code>.
93+
*/
94+
@Parameter(property = "console.consoleOauth2AccessToken")
95+
private String consoleOauth2AccessToken;
8296

8397
/**
8498
* Set this to "true" to skip installing packages to CRX although configured in the POM.
@@ -162,6 +176,13 @@ abstract class AbstractContentPackageMojo extends AbstractMojo {
162176
@Parameter(property = "vault.httpSocketTimeoutSec", defaultValue = "60")
163177
private int httpSocketTimeout;
164178

179+
/**
180+
* Log level to be used to log responses from package manager (which may get huge for large packages).
181+
* Possible values are INFO (default) or DEBUG.
182+
*/
183+
@Parameter(property = "vault.packageManagerOutputLogLevel", defaultValue = "INFO")
184+
private String packageManagerOutputLogLevel;
185+
165186
@Parameter(property = "session", defaultValue = "${session}", readonly = true)
166187
private MavenSession session;
167188

@@ -178,8 +199,10 @@ protected PackageManagerProperties getPackageManagerProperties() throws MojoExec
178199
props.setPackageManagerUrl(buildPackageManagerUrl());
179200
props.setUserId(this.userId);
180201
props.setPassword(this.password);
202+
props.setOAuth2AccessToken(this.oauth2AccessToken);
181203
props.setConsoleUserId(this.consoleUserId);
182204
props.setConsolePassword(this.consolePassword);
205+
props.setConsoleOAuth2AccessToken(this.consoleOauth2AccessToken);
183206
props.setRetryCount(this.retryCount);
184207
props.setRetryDelaySec(this.retryDelay);
185208
props.setBundleStatusUrl(buildBundleStatusUrl());
@@ -190,6 +213,7 @@ protected PackageManagerProperties getPackageManagerProperties() throws MojoExec
190213
props.setHttpConnectTimeoutSec(this.httpConnectTimeoutSec);
191214
props.setHttpSocketTimeoutSec(this.httpSocketTimeout);
192215
props.setProxies(ProxySupport.getMavenProxies(session, decrypter));
216+
props.setPackageManagerOutputLogLevel(this.packageManagerOutputLogLevel);
193217

194218
return props;
195219
}
@@ -198,10 +222,10 @@ private String buildPackageManagerUrl() throws MojoExecutionException {
198222
String serviceUrl = this.serviceURL;
199223
switch (VendorInstallerFactory.identify(serviceUrl)) {
200224
case CRX:
201-
serviceUrl = VendorInstallerFactory.getBaseUrl(serviceUrl, getLoggerWrapper()) + CRX_URL;
225+
serviceUrl = VendorInstallerFactory.getBaseUrl(serviceUrl) + CRX_URL;
202226
break;
203227
case COMPOSUM:
204-
serviceUrl = VendorInstallerFactory.getBaseUrl(serviceUrl, getLoggerWrapper()) + COMPOSUM_URL;
228+
serviceUrl = VendorInstallerFactory.getBaseUrl(serviceUrl) + COMPOSUM_URL;
205229
break;
206230
default:
207231
throw new MojoExecutionException("Unsupporte service URL: " + serviceUrl);
@@ -217,61 +241,8 @@ private String buildBundleStatusUrl() throws MojoExecutionException {
217241
return this.bundleStatusURL;
218242
}
219243
// if not set use hostname from serviceURL and add default path to bundle status
220-
String baseUrl = VendorInstallerFactory.getBaseUrl(buildPackageManagerUrl(), getLoggerWrapper());
244+
String baseUrl = VendorInstallerFactory.getBaseUrl(buildPackageManagerUrl());
221245
return baseUrl + "/system/console/bundles/.json";
222246
}
223247

224-
protected Logger getLoggerWrapper() {
225-
return new Logger() {
226-
@Override
227-
public void warn(CharSequence message, Throwable t) {
228-
getLog().warn(message, t);
229-
}
230-
@Override
231-
public void warn(CharSequence message) {
232-
getLog().warn(message);
233-
}
234-
@Override
235-
public boolean isWarnEnabled() {
236-
return getLog().isWarnEnabled();
237-
}
238-
@Override
239-
public boolean isInfoEnabled() {
240-
return getLog().isInfoEnabled();
241-
}
242-
@Override
243-
public boolean isErrorEnabled() {
244-
return getLog().isErrorEnabled();
245-
}
246-
@Override
247-
public boolean isDebugEnabled() {
248-
return getLog().isDebugEnabled();
249-
}
250-
@Override
251-
public void info(CharSequence message, Throwable t) {
252-
getLog().info(message, t);
253-
}
254-
@Override
255-
public void info(CharSequence message) {
256-
getLog().info(message);
257-
}
258-
@Override
259-
public void error(CharSequence message, Throwable t) {
260-
getLog().error(message, t);
261-
}
262-
@Override
263-
public void error(CharSequence message) {
264-
getLog().error(message);
265-
}
266-
@Override
267-
public void debug(CharSequence message, Throwable t) {
268-
getLog().debug(message, t);
269-
}
270-
@Override
271-
public void debug(CharSequence message) {
272-
getLog().debug(message);
273-
}
274-
};
275-
}
276-
277248
}

tooling/conga-aem-maven-plugin/src/main/java/io/wcm/devops/conga/plugins/aem/maven/InstallPackagesMojo.java

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,12 @@ public final class InstallPackagesMojo extends AbstractContentPackageMojo {
7676
@Parameter(property = "vault.delayAfterInstallSec")
7777
private Integer delayAfterInstallSec;
7878

79+
/**
80+
* Replicate package(s) to publish instance after upload.
81+
*/
82+
@Parameter(property = "vault.replicatePackage")
83+
private boolean replicate;
84+
7985
@Override
8086
public void execute() throws MojoExecutionException, MojoFailureException {
8187
if (isSkip()) {
@@ -88,18 +94,22 @@ public void execute() throws MojoExecutionException, MojoFailureException {
8894

8995
getLog().info("Get AEM content packages from " + getCanonicalPath(nodeDirectory));
9096

97+
// collect files to install
9198
ModelParser modelParser = new ModelParser();
9299
List<PackageFile> items = modelParser.getContentPackagesForNode(nodeDirectory).stream()
93100
.map(this::toPackageFile)
94101
.collect(Collectors.toList());
95102

103+
// ensure any file exist
96104
if (items.isEmpty()) {
97105
getLog().warn("No file found for installing.");
106+
return;
98107
}
99-
else {
100-
PackageInstaller installer = new PackageInstaller(getPackageManagerProperties(), getLoggerWrapper());
101-
installer.installFiles(items);
102-
}
108+
109+
// install files
110+
PackageInstaller installer = new PackageInstaller(getPackageManagerProperties());
111+
installer.setReplicate(this.replicate);
112+
installer.installFiles(items);
103113
}
104114

105115
private PackageFile toPackageFile(ModelContentPackageFile item) {

0 commit comments

Comments
 (0)