From f06d80752cbb01ffc24e532ecb7f77e5e2f027a8 Mon Sep 17 00:00:00 2001 From: Basil Crow Date: Wed, 30 Nov 2022 17:31:03 -0800 Subject: [PATCH] Temporarily support 2.332.x for BOM test suite (#406) --- .../org/jenkinsci/maven/plugins/hpi/ValidateMojo.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/jenkinsci/maven/plugins/hpi/ValidateMojo.java b/src/main/java/org/jenkinsci/maven/plugins/hpi/ValidateMojo.java index ffa6ea6d19..25eca2e695 100644 --- a/src/main/java/org/jenkinsci/maven/plugins/hpi/ValidateMojo.java +++ b/src/main/java/org/jenkinsci/maven/plugins/hpi/ValidateMojo.java @@ -39,7 +39,14 @@ public void execute() throws MojoExecutionException { } if (new VersionNumber(findJenkinsVersion()).compareTo(new VersionNumber("2.361")) < 0) { - throw new MojoExecutionException("This version of maven-hpi-plugin requires Jenkins 2.361 or later"); + if (System.getProperty("overrideWar") != null && System.getProperty("overrideWarAdditions") != null) { + /* + * Skip this check when running the BOM test suite. When the BOM drops support for 2.332.x and 2.346.x, + * we can throw the exception unconditionally. + */ + } else { + throw new MojoExecutionException("This version of maven-hpi-plugin requires Jenkins 2.361 or later"); + } } MavenProject parent = project.getParent();