Skip to content

Commit

Permalink
[WFARQ-184] Upgrade WildFly Plugin Tools ot 1.2.0.Beta1 and make need…
Browse files Browse the repository at this point in the history
…ed changes.

https://issues.redhat.com/browse/WFARQ-184
Signed-off-by: James R. Perkins <jperkins@redhat.com>
  • Loading branch information
jamezp committed Jul 23, 2024
1 parent f0869d8 commit 3324456
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 129 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public ArchiveDeployer(DomainDeploymentManager deploymentManager) {
public ArchiveDeployer(final ManagementClient client) {
Objects.requireNonNull(client, "The client cannot be null");
deploymentManagerDeprecated = null;
this.deploymentManager = DeploymentManager.Factory.create(client.getControllerClient());
this.deploymentManager = DeploymentManager.create(client.getControllerClient());
}

/**
Expand Down Expand Up @@ -114,12 +114,13 @@ public String deploy(Archive<?> archive, Set<String> serverGroups) throws Deploy
// If a deployment manager is available use it, otherwise default to the previous behavior
if (deploymentManager != null) {
final String name = archive.getName();
final DeploymentResult result = deploymentManager.deploy(Deployment.of(input, name)
.setServerGroups(serverGroups));
if (!result.successful()) {
throw new DeploymentException("Could not deploy to container: " + result.getFailureMessage());
try (Deployment deployment = Deployment.of(input, name).setServerGroups(serverGroups)) {
final DeploymentResult result = deploymentManager.deploy(deployment);
if (!result.successful()) {
throw new DeploymentException("Could not deploy to container: " + result.getFailureMessage());
}
return name;
}
return name;
} else {
// Fallback behavior if constructed with a DomainDeploymentManager
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public class ArchiveDeployer {
*/
@Deprecated
public ArchiveDeployer(ModelControllerClient modelControllerClient) {
this.deploymentManager = DeploymentManager.Factory.create(modelControllerClient);
this.deploymentManager = DeploymentManager.create(modelControllerClient);
client = null;
}

Expand All @@ -63,7 +63,7 @@ public ArchiveDeployer(ModelControllerClient modelControllerClient) {
*/
public ArchiveDeployer(ManagementClient client) {
this.client = client;
this.deploymentManager = DeploymentManager.Factory.create(client.getControllerClient());
this.deploymentManager = DeploymentManager.create(client.getControllerClient());
}

/**
Expand Down Expand Up @@ -163,8 +163,8 @@ private String deployInternal(Archive<?> archive) throws DeploymentException {
private String deployInternal(String name, InputStream input) throws DeploymentException {
checkState();
final DeploymentResult result;
try {
result = deploymentManager.deploy(Deployment.of(input, name));
try (Deployment deployment = Deployment.of(input, name)) {
result = deploymentManager.deploy(deployment);
} catch (Exception ex) {
throw createException("Cannot deploy: " + name, ex);
}
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ public final void start() throws LifecycleException {
// Note this won't work on Windows, but should work on other platforms
.process(ServerManager.findProcess().orElse(null))
.standalone();
serverManagerProducer.set(new ArquillianServerManager(serverManager));
serverManagerProducer.set(serverManager.asManaged());
}

try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ protected void startInternal() throws LifecycleException {
.client(getManagementClient().getControllerClient())
.process(ServerManager.findProcess().orElse(null))
.standalone();
serverManagerProducer.set(new ArquillianServerManager(serverManager));
serverManagerProducer.set(serverManager.asManaged());
return;
} else {
failDueToRunning(config);
Expand Down Expand Up @@ -83,7 +83,7 @@ protected void startInternal() throws LifecycleException {
}
timeoutSupported = isOperationAttributeSupported("shutdown", "timeout");
this.process = process;
serverManagerProducer.set(new ArquillianServerManager(serverManager));
serverManagerProducer.set(serverManager.asManaged());

} catch (LifecycleException e) {
throw e;
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
<version.org.slf4j>1.7.36</version.org.slf4j>
<version.org.wildfly.plugins.wildfly-jar-maven-plugin>11.0.2.Final</version.org.wildfly.plugins.wildfly-jar-maven-plugin>
<version.org.wildfly.plugins.wildfly-maven-plugin>5.0.0.Final</version.org.wildfly.plugins.wildfly-maven-plugin>
<version.org.wildfly.plugins.wildfly-plugin-tools>1.1.0.Final</version.org.wildfly.plugins.wildfly-plugin-tools>
<version.org.wildfly.plugins.wildfly-plugin-tools>1.2.0.Beta1</version.org.wildfly.plugins.wildfly-plugin-tools>

<!-- keep this in sync with version that is used in arquillian -->
<version.org.jboss.shrinkwrap>1.2.6</version.org.jboss.shrinkwrap>
Expand Down

0 comments on commit 3324456

Please sign in to comment.