diff --git a/src/main/java/org/jenkins/tools/test/hook/AnalysisPomExecutionHook.java b/src/main/java/org/jenkins/tools/test/hook/AnalysisPomExecutionHook.java new file mode 100644 index 000000000..87e2d7c82 --- /dev/null +++ b/src/main/java/org/jenkins/tools/test/hook/AnalysisPomExecutionHook.java @@ -0,0 +1,32 @@ +package org.jenkins.tools.test.hook; + +import java.util.Map; +import java.util.Set; +import org.jenkins.tools.test.model.PomData; + +/** + * Custom execution hook for plugins whose parent is {@code org.jvnet.hudson.plugins:analysis-pom}. + * These plugins use Maven Failsafe Plugin in their test suites. + */ +public class AnalysisPomExecutionHook extends PluginWithFailsafeIntegrationTestsHook { + + private static final Set ARTIFACT_IDS = + Set.of( + "analysis-model-api", + "bootstrap5-api", + "checks-api", + "echarts-api", + "font-awesome-api", + "forensics-api", + "jquery3-api", + "plugin-util-api", + "popper2-api"); + + @Override + public boolean check(Map info) { + PomData data = (PomData) info.get("pomData"); + return "io.jenkins.plugins".equals(data.groupId) + && ARTIFACT_IDS.contains(data.artifactId) + && "hpi".equals(data.getPackaging()); + } +} diff --git a/src/main/java/org/jenkins/tools/test/hook/PluginWithFailsafeIntegrationTestsHook.java b/src/main/java/org/jenkins/tools/test/hook/PluginWithFailsafeIntegrationTestsHook.java index cefb3fea4..28beb488b 100644 --- a/src/main/java/org/jenkins/tools/test/hook/PluginWithFailsafeIntegrationTestsHook.java +++ b/src/main/java/org/jenkins/tools/test/hook/PluginWithFailsafeIntegrationTestsHook.java @@ -7,7 +7,8 @@ * Workaround for those plugins with integration tests since they need execute the * failsafe:integration-test goal before execution. */ -public class PluginWithFailsafeIntegrationTestsHook extends PluginWithIntegrationTestsHook { +public abstract class PluginWithFailsafeIntegrationTestsHook + extends PluginWithIntegrationTestsHook { @Override public Collection getGoals() {