Skip to content

Commit 53e51fc

Browse files
committed
conga-aem-maven-plugin: Flag replicate allows to replicate a package to publish instance after uploading it to author instance.
1 parent 07d3f1c commit 53e51fc

2 files changed

Lines changed: 17 additions & 4 deletions

File tree

changes.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@
3030
<action type="add" dev="sseifert" issue="WTOOL-71">
3131
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.
3232
</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>
3336
<action type="add" dev="sseifert">
3437
conga-aem-maven-plugin: Add jcl-over-slf4j bridge to be able to capture HTTP client debug messages with Maven debug logging.
3538
</action>

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());
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)