Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for WFGP-279, Enforce that minimum stability enables the specified stability #289

Merged
merged 2 commits into from
Apr 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading