Skip to content

Commit

Permalink
Merge pull request #288 from jfdenise/main
Browse files Browse the repository at this point in the history
Upgrade to Galleon 6.0.0.Beta5, Add -level to stability related plugin options
  • Loading branch information
jfdenise authored Mar 28, 2024
2 parents f590045 + 4bb96ea commit c6dc1f8
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 49 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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();
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public class FeatureSpecGeneratorInvoker {
private Set<String> domainExtensions = Collections.emptySet();
private Set<String> hostExtensions = Collections.emptySet();
private List<Path> layersConfs = Collections.emptyList();
private String minimumStability;
private String minimumStabilityLevel;

private WildFlyPackageTasksParser tasksParser;
private ProvisioningLayoutFactory layoutFactory;
Expand All @@ -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();
}

Expand Down Expand Up @@ -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 {
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.Beta4</version.org.jboss.galleon>
<version.org.jboss.galleon>6.0.0.Beta5</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
6 changes: 3 additions & 3 deletions testsuite/test-feature-packs/community-feature-pack/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,9 @@
<phase>compile</phase>
<configuration>
<config-file>target/resources/build/wildfly-feature-pack-build.xml</config-file>
<minimumStability>community</minimumStability>
<config-stability>community</config-stability>
<package-stability>community</package-stability>
<minimum-stability-level>community</minimum-stability-level>
<config-stability-level>community</config-stability-level>
<package-stability-level>community</package-stability-level>
<release-name>Test</release-name>
</configuration>
</execution>
Expand Down
6 changes: 3 additions & 3 deletions testsuite/test-feature-packs/default-feature-pack/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,9 @@
<phase>compile</phase>
<configuration>
<config-file>target/resources/build/wildfly-feature-pack-build.xml</config-file>
<minimumStability>default</minimumStability>
<config-stability>default</config-stability>
<package-stability>default</package-stability>
<minimum-stability-level>default</minimum-stability-level>
<config-stability-level>default</config-stability-level>
<package-stability-level>default</package-stability-level>
<release-name>Test</release-name>
</configuration>
</execution>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@
<phase>compile</phase>
<configuration>
<config-file>target/resources/build/wildfly-feature-pack-build.xml</config-file>
<minimumStability>experimental</minimumStability>
<stability>experimental</stability>
<minimum-stability-level>experimental</minimum-stability-level>
<stability-level>experimental</stability-level>
<release-name>Test</release-name>
</configuration>
</execution>
Expand Down
4 changes: 2 additions & 2 deletions testsuite/test-feature-packs/preview-feature-pack/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@
<phase>compile</phase>
<configuration>
<config-file>target/resources/build/wildfly-feature-pack-build.xml</config-file>
<minimumStability>preview</minimumStability>
<stability>preview</stability>
<minimum-stability-level>preview</minimum-stability-level>
<stability-level>preview</stability-level>
<release-name>Test</release-name>
</configuration>
</execution>
Expand Down

0 comments on commit c6dc1f8

Please sign in to comment.