Skip to content

Commit

Permalink
Merge pull request #289 from jfdenise/WFGP-279
Browse files Browse the repository at this point in the history
Fix for WFGP-279, Enforce that minimum stability enables the specified stability
  • Loading branch information
jfdenise authored Apr 3, 2024
2 parents 680dc8f + 4bdefa3 commit e77241b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -266,13 +266,27 @@ 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) {
throw e;
}
}

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<String, FeaturePackDescription> getFpDependencies() {
return fpDependencies;
}
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
<version.org.codehaus.mojo.xml-maven-plugin>1.0.1</version.org.codehaus.mojo.xml-maven-plugin>
<version.org.codehaus.plexus.plexus-utils>3.1.0</version.org.codehaus.plexus.plexus-utils>
<version.org.eclipse.aether>1.1.0</version.org.eclipse.aether>
<version.org.jboss.galleon>6.0.0.Beta5</version.org.jboss.galleon>
<version.org.jboss.galleon>6.0.0.Beta6</version.org.jboss.galleon>
<version.org.jboss.dmr>1.5.0.Final</version.org.jboss.dmr>

<version.org.wildfly.channel>1.0.5.Final</version.org.wildfly.channel>
Expand Down

0 comments on commit e77241b

Please sign in to comment.