You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by gn...@apache.org on 2026/08/31 11:57:12 UTC
(maven-deploy-plugin) 06/07: fix: f006 (MEDIUM) — Verified-true doc fix plus visibility escalation, per the finding brief.
This is an automated email from the ASF dual-hosted git repository.
gnodet pushed a commit to branch security/audit-medium-fixes
in repository https://gitbox.apache.org/repos/asf/maven-deploy-plugin.git
commit a5e9653b5e021d0870c06490cffff954cc59d3bc
Author: Guillaume Nodet <gn...@gmail.com>
AuthorDate: Mon Aug 31 13:46:28 2026 +0200
fix: f006 (MEDIUM) — Verified-true doc fix plus visibility escalation, per the finding brief.
Security audit finding f006 (MEDIUM).
Verified-true doc fix plus visibility escalation, per the finding brief. The deployAtEnd javadoc now states the real semantics: batch fires when the last deploy-bound project reaches its deploy phase (trailing execution-less modules can still fail afterward), multi-repo/mixed-retry requests deploy sequentially with no rollback, and deployAtEnd=false modules cannot be recalled; the false 'none of the reactor projects is deployed' sentence and the incoherent '(experimental)' marker (on [...]
Co-Authored-By: Claude Opus 4.6 <no...@anthropic.com>
---
.../apache/maven/plugins/deploy/DeployMojo.java | 39 +++++++++++++++++++---
1 file changed, 35 insertions(+), 4 deletions(-)
diff --git a/src/main/java/org/apache/maven/plugins/deploy/DeployMojo.java b/src/main/java/org/apache/maven/plugins/deploy/DeployMojo.java
index 381675d..3e7e977 100644
--- a/src/main/java/org/apache/maven/plugins/deploy/DeployMojo.java
+++ b/src/main/java/org/apache/maven/plugins/deploy/DeployMojo.java
@@ -64,9 +64,24 @@ public class DeployMojo extends AbstractDeployMojo {
private MojoExecution mojoExecution;
/**
- * Whether every project should be deployed during its own deploy-phase or at the end of the multimodule build. If
- * set to {@code true} and the build fails, none of the reactor projects is deployed.
- * <strong>(experimental)</strong>
+ * Whether every project should be deployed during its own deploy-phase or at the end of the multimodule build.
+ * When set to {@code true}, the deploy requests of all projects with a bound deploy execution are collected and
+ * executed together once the last such project has reached its deploy phase, which reduces the chance of
+ * publishing artifacts from a build that subsequently fails.
+ * <p>
+ * <strong>This is not an atomic, all-or-nothing guarantee.</strong> In particular:
+ * <ul>
+ * <li>The batch fires when the last project <em>with a deploy execution</em> reaches its deploy phase.
+ * Reactor projects built after that point (for example trailing modules that skip or do not bind the
+ * deploy goal, such as integration-test aggregators) can still fail <em>after</em> all artifacts have
+ * been published.</li>
+ * <li>When the batch spans several repositories or retry configurations, the resulting requests are
+ * deployed sequentially: a failure part-way through leaves the repositories already deployed to
+ * published, with no rollback. The build log reports which repositories had already been deployed
+ * when this happens.</li>
+ * <li>Projects configured with {@code deployAtEnd=false} deploy immediately during their own deploy
+ * phase and cannot be recalled by a later build failure.</li>
+ * </ul>
*
* @since 2.8
*/
@@ -313,7 +328,23 @@ public class DeployMojo extends AbstractDeployMojo {
}
// Deploy
if (!requests.isEmpty()) {
- requests.forEach(this::deploy);
+ // Requests are deployed sequentially and there is no rollback: if one fails, make the
+ // partial-publication state explicit instead of only surfacing the failing module.
+ List<String> deployedRepositoryIds = new ArrayList<>();
+ for (ArtifactDeployerRequest request : requests) {
+ try {
+ deploy(request);
+ } catch (RuntimeException e) {
+ if (!deployedRepositoryIds.isEmpty()) {
+ getLog().error("Deploy-at-end batch failed after " + deployedRepositoryIds.size() + " of "
+ + requests.size() + " deploy request(s) had already completed. Artifacts already"
+ + " published to repository id(s) " + String.join(", ", deployedRepositoryIds)
+ + " remain published: there is no rollback.");
+ }
+ throw e;
+ }
+ deployedRepositoryIds.add(request.getRepository().getId());
+ }
} else {
getLog().info("No actual deploy requests");
}