diff --git a/src/main/groovy/io/micronaut/build/MicronautBasePlugin.groovy b/src/main/groovy/io/micronaut/build/MicronautBasePlugin.groovy index bd29d5ed..da9319cb 100644 --- a/src/main/groovy/io/micronaut/build/MicronautBasePlugin.groovy +++ b/src/main/groovy/io/micronaut/build/MicronautBasePlugin.groovy @@ -39,7 +39,11 @@ class MicronautBasePlugin implements Plugin { } private void configureProjectVersion(Project project) { - project.version = project.providers.gradleProperty("projectVersion").orElse("undefined").get() + def version = project.providers.gradleProperty("projectVersion").orElse("undefined").get() + if (version.isEmpty() || !Character.isDigit(version.charAt(0))) { + throw new IllegalArgumentException("Version '" + version + "' is not a valid Micronaut version. It must start with a digit.") + } + project.version = version } }