From 24ca9069f8f475651ca0c9449817e37ff2b40202 Mon Sep 17 00:00:00 2001 From: Jean Francois Denise Date: Thu, 28 Mar 2024 10:42:11 +0100 Subject: [PATCH 1/2] Add -level to all stability options --- .../maven/AbstractFeaturePackBuildMojo.java | 66 +++++++++---------- .../maven/FeatureSpecGeneratorInvoker.java | 10 +-- .../community-feature-pack/pom.xml | 6 +- .../default-feature-pack/pom.xml | 6 +- .../experimental-feature-pack/pom.xml | 4 +- .../preview-feature-pack/pom.xml | 4 +- 6 files changed, 48 insertions(+), 48 deletions(-) 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 6cd7df4a..75c11704 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 @@ -207,33 +207,33 @@ static boolean isProvided(String module) { private MavenProjectHelper projectHelper; /** - * The minimum stability level of the WildFly processes used to generate feature specs. + * The minimum stability level of the WildFly processes used to generate feature specs and include packages. * Set this if you need to generate feature specs for features with a lower stability level * than the default level of the WildFly process being used for feature-spec generation. */ - @Parameter(alias = "minimum-stability", required = false) - protected String minimumStability; + @Parameter(alias = "minimum-stability-level", required = false) + protected String minimumStabilityLevel; /** * The default stability level used at provisioning time to generate - * configuration and provision packages. Can't be used when {@code config-stability} or {@code package-stability} is set. + * configuration and provision packages. Can't be used when {@code config-stability-level} or {@code package-stability-level} is set. */ - @Parameter(alias = "stability", required = false) - protected String stability; + @Parameter(alias = "stability-level", required = false) + protected String stabilityLevel; /** * The default stability level used at provisioning time to generate - * configuration. Can't be used when {@code stability} is set. + * configuration. Can't be used when {@code stability-level} is set. */ - @Parameter(alias = "config-stability", required = false) - protected String configStatibility; + @Parameter(alias = "config-stability-level", required = false) + protected String configStatibilityLevel; /** * The default stability level used at provisioning time when installing packages/JBoss Modules modules. - * Can't be used when {@code stability} is set. + * Can't be used when {@code stability-level} is set. */ - @Parameter(alias = "package-stability", required = false) - protected String packageStatibility; + @Parameter(alias = "package-stability-level", required = false) + protected String packageStatibilityLevel; private MavenProjectArtifactVersions artifactVersions; @@ -245,26 +245,26 @@ static boolean isProvided(String module) { private Path resourcesWildFly; private Path fpResourcesDir; private Path resourcesDir; - private Stability buildTimestability; - private Stability defaultConfigStability; - private Stability defaultPackageStability; + private Stability buildTimestabilityLevel; + private Stability defaultConfigStabilityLevel; + private Stability defaultPackageStabilityLevel; @Override public void execute() throws MojoExecutionException, MojoFailureException { try { - buildTimestability = minimumStability == null ? null : Stability.fromString(minimumStability); - if (stability == null) { - defaultConfigStability = configStatibility == null ? null : Stability.fromString(configStatibility); - defaultPackageStability = packageStatibility == null ? null : Stability.fromString(packageStatibility); + buildTimestabilityLevel = minimumStabilityLevel == null ? null : Stability.fromString(minimumStabilityLevel); + if (stabilityLevel == null) { + defaultConfigStabilityLevel = configStatibilityLevel == null ? null : Stability.fromString(configStatibilityLevel); + defaultPackageStabilityLevel = packageStatibilityLevel == null ? null : Stability.fromString(packageStatibilityLevel); } else { - if (configStatibility != null) { - throw new MojoExecutionException("stability option can't be set when config-stability option is set"); + if (configStatibilityLevel != null) { + throw new MojoExecutionException("stability option can't be set when config-stability-level option is set"); } - if (packageStatibility != null) { - throw new MojoExecutionException("stability option can't be set when package-stability option is set"); + if (packageStatibilityLevel != null) { + throw new MojoExecutionException("stability option can't be set when package-stability-level option is set"); } - defaultConfigStability = Stability.fromString(stability); - defaultPackageStability = Stability.fromString(stability); + defaultConfigStabilityLevel = Stability.fromString(stabilityLevel); + defaultPackageStabilityLevel = Stability.fromString(stabilityLevel); } artifactVersions = MavenProjectArtifactVersions.getInstance(project); doExecute(); @@ -416,8 +416,8 @@ protected void buildFeaturePack(FeaturePackDescription.Builder fpBuilder, WildFl final FeaturePackDescription fpLayout; try { - fpBuilder.getSpecBuilder().setConfigStability(defaultConfigStability); - fpBuilder.getSpecBuilder().setPackageStability(defaultPackageStability); + fpBuilder.getSpecBuilder().setConfigStability(defaultConfigStabilityLevel); + fpBuilder.getSpecBuilder().setPackageStability(defaultPackageStabilityLevel); fpLayout = fpBuilder.build(); FeaturePackXmlWriter.getInstance().write(fpLayout.getSpec(), getFpDir().resolve(Constants.FEATURE_PACK_XML)); } catch (XMLStreamException | IOException | ProvisioningDescriptionException e) { @@ -526,10 +526,10 @@ private void addConfigPackages(final Path configDir, final Path packagesDir, fin } Stability packageStability = pkgSpec.getStability(); if (packageStability != null) { - if (buildTimestability != null && !buildTimestability.enables(packageStability)) { + if (buildTimestabilityLevel != null && !buildTimestabilityLevel.enables(packageStability)) { getLog().warn("Package " + pkgSpec.getName() + " is not included in the feature-pack. " + "Package stability '" - + packageStability + "' is not enabled by the '" + buildTimestability + + packageStability + "' is not enabled by the '" + buildTimestabilityLevel + "' stability level that is the feature-pack minimum stability level."); continue; } @@ -570,10 +570,10 @@ private void addFeatures(final Path configDir, final Path featuresDir) throws Mo } Stability featureStability = featureSpec.getStability(); if (featureStability != null) { - if (buildTimestability != null && !buildTimestability.enables(featureStability)) { + if (buildTimestabilityLevel != null && !buildTimestabilityLevel.enables(featureStability)) { getLog().warn("Feature " + featureSpec.getName() + " is not included in the feature-pack. " + "Feature stability '" - + featureStability + "' is not enabled by the '" + buildTimestability + + featureStability + "' is not enabled by the '" + buildTimestabilityLevel + "' stability level that is the feature-pack minimum stability level."); continue; } @@ -813,10 +813,10 @@ private void packageModules(FeaturePackDescription.Builder fpBuilder, String packageStability = parsedModule.getProperty(WfConstants.JBOSS_STABILITY); if (packageStability != null) { Stability stab = Stability.fromString(packageStability); - if (buildTimestability != null && !buildTimestability.enables(stab)) { + if (buildTimestabilityLevel != null && !buildTimestabilityLevel.enables(stab)) { getLog().warn("JBoss Modules module " + parsedModule.getIdentifier() + " is not included in the feature-pack. " + "Package stability '" + - packageStability + "' is not enabled by the '" + buildTimestability + + packageStability + "' is not enabled by the '" + buildTimestabilityLevel + "' stability level that is the feature-pack minimum stability level."); continue; } diff --git a/maven-plugin/src/main/java/org/wildfly/galleon/maven/FeatureSpecGeneratorInvoker.java b/maven-plugin/src/main/java/org/wildfly/galleon/maven/FeatureSpecGeneratorInvoker.java index c5c596fd..d51cc10b 100644 --- a/maven-plugin/src/main/java/org/wildfly/galleon/maven/FeatureSpecGeneratorInvoker.java +++ b/maven-plugin/src/main/java/org/wildfly/galleon/maven/FeatureSpecGeneratorInvoker.java @@ -123,7 +123,7 @@ public class FeatureSpecGeneratorInvoker { private Set domainExtensions = Collections.emptySet(); private Set hostExtensions = Collections.emptySet(); private List layersConfs = Collections.emptyList(); - private String minimumStability; + private String minimumStabilityLevel; private WildFlyPackageTasksParser tasksParser; private ProvisioningLayoutFactory layoutFactory; @@ -139,7 +139,7 @@ public class FeatureSpecGeneratorInvoker { this.forkEmbedded = mojo.forkEmbedded; this.wildflyHome = mojo.wildflyHome.toPath(); this.moduleTemplatesDir = mojo.moduleTemplatesDir.toPath(); - this.minimumStability = mojo.minimumStability; + this.minimumStabilityLevel = mojo.minimumStabilityLevel; this.log = mojo.getLog(); } @@ -722,12 +722,12 @@ private void debug(String format, Object... args) { } private Object getFeaturePackGenerator(Class specGenCls) throws NoSuchMethodException, InvocationTargetException, InstantiationException, IllegalAccessException { - debug("Creating a feature spec generator for stability %s using %s", minimumStability, specGenCls); + debug("Creating a feature spec generator for stability %s using %s", minimumStabilityLevel, specGenCls); try { return specGenCls.getConstructor(String.class, Path.class, Map.class, String.class, boolean.class, boolean.class) - .newInstance(wildflyHome.toString(), featureSpecsOutput.toPath(), inheritedFeatureSpecs, minimumStability, forkEmbedded, log.isDebugEnabled()); + .newInstance(wildflyHome.toString(), featureSpecsOutput.toPath(), inheritedFeatureSpecs, minimumStabilityLevel, forkEmbedded, log.isDebugEnabled()); } catch (NoSuchMethodException e) { - if (minimumStability != null && !minimumStability.isEmpty()) { + if (minimumStabilityLevel != null && !minimumStabilityLevel.isEmpty()) { return specGenCls.getConstructor(String.class, Path.class, Map.class, boolean.class, boolean.class) .newInstance(wildflyHome.toString(), featureSpecsOutput.toPath(), inheritedFeatureSpecs, forkEmbedded, log.isDebugEnabled()); } else { diff --git a/testsuite/test-feature-packs/community-feature-pack/pom.xml b/testsuite/test-feature-packs/community-feature-pack/pom.xml index a49174e7..e6bd4062 100644 --- a/testsuite/test-feature-packs/community-feature-pack/pom.xml +++ b/testsuite/test-feature-packs/community-feature-pack/pom.xml @@ -118,9 +118,9 @@ compile target/resources/build/wildfly-feature-pack-build.xml - community - community - community + community + community + community Test diff --git a/testsuite/test-feature-packs/default-feature-pack/pom.xml b/testsuite/test-feature-packs/default-feature-pack/pom.xml index e6a827b3..5064541d 100644 --- a/testsuite/test-feature-packs/default-feature-pack/pom.xml +++ b/testsuite/test-feature-packs/default-feature-pack/pom.xml @@ -118,9 +118,9 @@ compile target/resources/build/wildfly-feature-pack-build.xml - default - default - default + default + default + default Test diff --git a/testsuite/test-feature-packs/experimental-feature-pack/pom.xml b/testsuite/test-feature-packs/experimental-feature-pack/pom.xml index e1c61ad2..4477d247 100644 --- a/testsuite/test-feature-packs/experimental-feature-pack/pom.xml +++ b/testsuite/test-feature-packs/experimental-feature-pack/pom.xml @@ -118,8 +118,8 @@ compile target/resources/build/wildfly-feature-pack-build.xml - experimental - experimental + experimental + experimental Test diff --git a/testsuite/test-feature-packs/preview-feature-pack/pom.xml b/testsuite/test-feature-packs/preview-feature-pack/pom.xml index 291772f9..aed339d5 100644 --- a/testsuite/test-feature-packs/preview-feature-pack/pom.xml +++ b/testsuite/test-feature-packs/preview-feature-pack/pom.xml @@ -118,8 +118,8 @@ compile target/resources/build/wildfly-feature-pack-build.xml - preview - preview + preview + preview Test From 4bb96ea32cd11dba71756eed6ae9bc45a96c5060 Mon Sep 17 00:00:00 2001 From: Jean Francois Denise Date: Thu, 28 Mar 2024 10:42:32 +0100 Subject: [PATCH 2/2] Upgrade to Galleon 6.0.0.Beta5 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 738fab68..b9271aef 100644 --- a/pom.xml +++ b/pom.xml @@ -77,7 +77,7 @@ 1.0.1 3.1.0 1.1.0 - 6.0.0.Beta4 + 6.0.0.Beta5 1.5.0.Final 1.0.5.Final