diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index bd0fbf4d687f53f96440917c50553fcc5bbdeae2..0b346d9b546499a3080cd6ae85c510e12263ce9f 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -33,6 +33,8 @@ test:
 deploy-snapshot:
   stage: deploy
   script:
+    - export VERSION=$(./mvnw --batch-mode --no-transfer-progress --non-recursive help:evaluate -Dexpression=project.version | grep -v "\[.*")
+    - if ! [[ $VERSION =~ .*SNAPSHOT ]]; then exit 1; fi
     - ./mvnw $MAVEN_CLI_OPTS $MAVEN_OPTS deploy -DskipTests
   tags:
     - vips-java