diff --git a/CHANGELOG.md b/CHANGELOG.md
index ff2e4f7..e98191f 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,12 @@
+## [vNext] - dNext
+### Updated
+- Check if using a custom batch id before archiving it. [Trello 2201](https://trello.com/c/B8KrpLpF)
+- Update `jenkins.version` to version `2.361.4` as [recommended here](https://www.jenkins.io/doc/developer/plugin-development/choosing-jenkins-baseline/).
+- Update parent pom to `4.51`.
+- Remove deprecated `java.level` property.
+- Bump JobDSL to `1.72` to rely on non-vulnerable version.
+- Rely on Jenkins core BOM for workflow plugins versions.
+
## [1.14] - 2023-02-27
### Fixed
- Fixed crash on newer Jenkins versions.
diff --git a/pom.xml b/pom.xml
index 4c240d2..bced164 100644
--- a/pom.xml
+++ b/pom.xml
@@ -5,7 +5,7 @@
org.jenkins-ci.plugins
plugin
- 2.22
+ 4.51
applitools-eyes
@@ -30,11 +30,10 @@
- 2.22
-
- 7
- 1.15
- 1.52
+
+ 2.361.4
+
+ 1.72
@@ -45,16 +44,26 @@
+
+
+
+ io.jenkins.tools.bom
+ bom-2.303.x
+ 1409.v7659b_c072f18
+ pom
+ import
+
+
+
+
org.jenkins-ci.plugins.workflow
workflow-step-api
- ${plugins.workflow.version}
org.jenkins-ci.plugins.workflow
workflow-job
- ${plugins.workflow.version}
org.jenkins-ci.plugins
diff --git a/src/main/java/com/applitools/jenkins/ApplitoolsBuildWrapper.java b/src/main/java/com/applitools/jenkins/ApplitoolsBuildWrapper.java
index 7bcbdf0..2364c1c 100644
--- a/src/main/java/com/applitools/jenkins/ApplitoolsBuildWrapper.java
+++ b/src/main/java/com/applitools/jenkins/ApplitoolsBuildWrapper.java
@@ -31,6 +31,8 @@ public class ApplitoolsBuildWrapper extends BuildWrapper implements Serializable
public boolean notifyByCompletion;
public String applitoolsApiKey;
+ private static boolean isCustomBatchId = false;
+
static final Map ARTIFACT_PATHS = new HashMap();
static {
@@ -67,7 +69,9 @@ public Environment setUp(final AbstractBuild build, final Launcher launcher, fin
return new Environment() {
@Override
public boolean tearDown(AbstractBuild build, BuildListener listener) throws IOException, InterruptedException {
- build.pickArtifactManager().archive(build.getWorkspace(), launcher, listener, ARTIFACT_PATHS);
+ if (isCustomBatchId) {
+ build.pickArtifactManager().archive(build.getWorkspace(), launcher, listener, ARTIFACT_PATHS);
+ }
ApplitoolsCommon.closeBatch(build, listener, serverURL, notifyByCompletion, applitoolsApiKey);
return true;
}
@@ -92,8 +96,10 @@ public static Map getApplitoolsArtifactList(AbstractBuild build,
Matcher m = ApplitoolsCommon.artifactRegexp.matcher(apath.getKey());
if (m.find()) {
applitoolsArtifacts.put(m.group(1), value);
+ isCustomBatchId = true;
}
} catch (IOException e) {
+ isCustomBatchId = false;
listener.getLogger().println(String.format("Custom BATCH_ID is not defined: %s", rootDir.child(apath.getValue())));
}
}