Skip to content

Commit

Permalink
[CONVERSION COMMIT] Remove dry run support
Browse files Browse the repository at this point in the history
  • Loading branch information
jfdenise committed Nov 26, 2024
1 parent 9833978 commit f8f055e
Showing 1 changed file with 3 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -214,15 +214,6 @@ abstract class AbstractProvisionServerMojo extends AbstractMojo {
@Parameter(alias = "channels", property = PropertyNames.CHANNELS)
List<ChannelConfiguration> channels;

/**
* Do not actually provision a server but generate the Galleon provisioning configuration
* in {@code target/.wildfly-maven-plugin-provisioning.xml} file.
*
* @since 5.0
*/
@Parameter(alias = "dry-run")
boolean dryRun;

private Path wildflyDir;

protected MavenRepoManager artifactResolver;
Expand All @@ -233,9 +224,6 @@ public void execute() throws MojoExecutionException, MojoFailureException {
getLog().debug(String.format("Skipping " + getGoal() + " of %s:%s", project.getGroupId(), project.getArtifactId()));
return;
}
if (dryRun) {
getLog().info("Dry run execution, no server will be provisioned.");
}
Path targetPath = Paths.get(project.getBuild().getDirectory());
wildflyDir = targetPath.resolve(provisioningDir).normalize();
if (!overwriteProvisionedServer && Files.exists(wildflyDir)) {
Expand Down Expand Up @@ -264,12 +252,10 @@ public void execute() throws MojoExecutionException, MojoFailureException {
try {
try {
provisionServer(wildflyDir);
if (!dryRun) {
if (artifactResolver instanceof ChannelMavenArtifactRepositoryManager) {
((ChannelMavenArtifactRepositoryManager) artifactResolver).done(wildflyDir);
}
serverProvisioned(wildflyDir);
if (artifactResolver instanceof ChannelMavenArtifactRepositoryManager) {
((ChannelMavenArtifactRepositoryManager) artifactResolver).done(wildflyDir);
}
serverProvisioned(wildflyDir);
} catch (ProvisioningException | IOException | XMLStreamException ex) {
throw new MojoExecutionException("Provisioning failed", ex);
}
Expand Down Expand Up @@ -301,13 +287,6 @@ private void provisionServer(Path home) throws ProvisioningException,
.setLogTime(logProvisioningTime)
.setRecordState(recordProvisioningState)
.build()) {
if (dryRun) {
Path targetPath = Paths.get(project.getBuild().getDirectory());
Path file = targetPath.resolve(PLUGIN_PROVISIONING_FILE);
getLog().info("Dry-run execution, generating provisioning.xml file: " + file);
pm.storeProvisioningConfig(config, file);
return;
}
getLog().info("Provisioning server in " + home);
PluginProgressTracker.initTrackers(pm, new MavenJBossLogger(getLog()));
pm.provision(config);
Expand Down

0 comments on commit f8f055e

Please sign in to comment.