diff --git a/maven-plugin/src/main/java/org/wildfly/galleon/maven/AbstractFeaturePackBuildMojo.java b/maven-plugin/src/main/java/org/wildfly/galleon/maven/AbstractFeaturePackBuildMojo.java index 75c11704..401ddcf8 100644 --- a/maven-plugin/src/main/java/org/wildfly/galleon/maven/AbstractFeaturePackBuildMojo.java +++ b/maven-plugin/src/main/java/org/wildfly/galleon/maven/AbstractFeaturePackBuildMojo.java @@ -266,6 +266,8 @@ public void execute() throws MojoExecutionException, MojoFailureException { defaultConfigStabilityLevel = Stability.fromString(stabilityLevel); defaultPackageStabilityLevel = Stability.fromString(stabilityLevel); } + // Check that the minimum Stability level enables the stability level + checkStabilityLevels(buildTimestabilityLevel, defaultConfigStabilityLevel, defaultPackageStabilityLevel); artifactVersions = MavenProjectArtifactVersions.getInstance(project); doExecute(); } catch (RuntimeException | Error | MojoExecutionException | MojoFailureException e) { @@ -273,6 +275,18 @@ public void execute() throws MojoExecutionException, MojoFailureException { } } + private static void checkStabilityLevels(Stability min, Stability config, Stability pkg) throws MojoExecutionException { + min = min == null ? Stability.DEFAULT : min; + config = config == null ? Stability.DEFAULT : config; + pkg = pkg == null ? Stability.DEFAULT : pkg; + if (!min.enables(config)) { + throw new MojoExecutionException("The minimum stability " + min + " doesn't enable the config stability " + config); + } + if (!min.enables(pkg)) { + throw new MojoExecutionException("The minimum stability " + min + " doesn't enable the package stability " + pkg); + } + } + protected Map getFpDependencies() { return fpDependencies; } diff --git a/pom.xml b/pom.xml index ebdb2cfb..9a45552f 100644 --- a/pom.xml +++ b/pom.xml @@ -77,7 +77,7 @@ 1.0.1 3.1.0 1.1.0 - 6.0.0.Beta5 + 6.0.0.Beta6 1.5.0.Final 1.0.5.Final