diff --git a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/plugin/ProcessPluginProviderImpl.java b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/plugin/ProcessPluginProviderImpl.java index d04755555..06d9a9cc8 100644 --- a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/plugin/ProcessPluginProviderImpl.java +++ b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/plugin/ProcessPluginProviderImpl.java @@ -16,6 +16,8 @@ import java.util.ServiceLoader; import java.util.ServiceLoader.Provider; import java.util.function.BinaryOperator; +import java.util.regex.Matcher; +import java.util.regex.Pattern; import java.util.stream.Collectors; import java.util.stream.Stream; @@ -47,6 +49,9 @@ private static final class Pair public static final String FILE_DRAFT_SUFIX = "-SNAPSHOT.jar"; public static final String FOLDER_DRAFT_SUFIX = "-SNAPSHOT"; + public static final String RC_AND_M_PATTERN_STRING = "^(.+)((-RC[0-9]+)|(-M[0-9]+))\\.jar$"; + private static final Pattern RC_AND_M_PATTERN = Pattern.compile(RC_AND_M_PATTERN_STRING); + private static final Logger logger = LoggerFactory.getLogger(ProcessPluginProviderImpl.class); private final FhirContext fhirContext; @@ -247,6 +252,13 @@ private Stream findDefinition(Map fileNames = definitionsByJar.keySet().stream() + .filter(filename -> matchesReleaseCandidateMilestonePatternAndIsDependency(filename, dependency)) + .collect(Collectors.toList()); + if (fileNames.size() == 1) + return definitionsByJar.get(fileNames.get(0)).getJars().stream(); + ProcessPluginDefinitionAndClassLoader bySnapshotJar = definitionsByJar.get(dependency + "-SNAPSHOT.jar"); if (bySnapshotJar != null) return bySnapshotJar.getJars().stream(); @@ -254,6 +266,15 @@ private Stream findDefinition(Map dependencyJars) {