From 86689147306a6d4ca05d32deea52e0c35d3a5078 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Lehmann-M=C3=B6rz?= Date: Mon, 2 Oct 2023 14:18:16 +0200 Subject: [PATCH] fix #2877 --- .../org/eclipse/tycho/versions/VersionBumpBuildListener.java | 4 ++++ .../main/java/org/eclipse/tycho/versions/engine/Versions.java | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/tycho-versions-plugin/src/main/java/org/eclipse/tycho/versions/VersionBumpBuildListener.java b/tycho-versions-plugin/src/main/java/org/eclipse/tycho/versions/VersionBumpBuildListener.java index 01ebfe7baa..d54042ffcd 100644 --- a/tycho-versions-plugin/src/main/java/org/eclipse/tycho/versions/VersionBumpBuildListener.java +++ b/tycho-versions-plugin/src/main/java/org/eclipse/tycho/versions/VersionBumpBuildListener.java @@ -78,6 +78,10 @@ public void buildEnded(MavenSession session) { String newVersion = suggestedVersion.map(String::valueOf) .orElseGet(() -> Versions.incrementVersion(currentVersion, VersionBumpMojo.getIncrement(session, project, projectHelper))); + boolean isSnapshot = currentVersion.endsWith(Versions.SUFFIX_SNAPSHOT); + if (isSnapshot) { + newVersion += Versions.SUFFIX_SNAPSHOT; + } logger.info(project.getId() + " requires a version bump from " + currentVersion + " => " + newVersion); engine.setProjects(metadataReader.getProjects()); diff --git a/tycho-versions-plugin/src/main/java/org/eclipse/tycho/versions/engine/Versions.java b/tycho-versions-plugin/src/main/java/org/eclipse/tycho/versions/engine/Versions.java index 9fd6d01405..5bb105cbcf 100644 --- a/tycho-versions-plugin/src/main/java/org/eclipse/tycho/versions/engine/Versions.java +++ b/tycho-versions-plugin/src/main/java/org/eclipse/tycho/versions/engine/Versions.java @@ -17,9 +17,9 @@ import org.osgi.framework.Version; public class Versions { - private static final String SUFFIX_QUALIFIER = ".qualifier"; + public static final String SUFFIX_QUALIFIER = ".qualifier"; - private static final String SUFFIX_SNAPSHOT = "-SNAPSHOT"; + public static final String SUFFIX_SNAPSHOT = "-SNAPSHOT"; public static String toCanonicalVersion(String version) { if (version == null) {