From bddf51a11813e6e0ecde54ee57a6c5cf5d1b896d Mon Sep 17 00:00:00 2001 From: Emmanuel Hugonnet Date: Fri, 26 May 2023 17:05:56 +0200 Subject: [PATCH] [WFMP-208]: dev mode deployment runtime name is not configurable. * Adding a new 'name' parameter with the same property as for the package mojo. Jira: https://issues.redhat.com/browse/WFMP-208 Signed-off-by: Emmanuel Hugonnet Signed-off-by: James R. Perkins --- .../main/java/org/wildfly/plugin/dev/DevMojo.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/plugin/src/main/java/org/wildfly/plugin/dev/DevMojo.java b/plugin/src/main/java/org/wildfly/plugin/dev/DevMojo.java index f41f3a84..47101081 100644 --- a/plugin/src/main/java/org/wildfly/plugin/dev/DevMojo.java +++ b/plugin/src/main/java/org/wildfly/plugin/dev/DevMojo.java @@ -342,6 +342,14 @@ public class DevMojo extends AbstractServerStartMojo { @Parameter(alias = "channels") private List channels; + /** + * Specifies the name used for the deployment. + * + * When the deployment is copied to the server, it is renamed with this name. + */ + @Parameter(property = PropertyNames.DEPLOYMENT_NAME) + private String name; + // Lazily loaded list of patterns based on the ignorePatterns private final List ignoreUpdatePatterns = new ArrayList<>(); // Lazy loaded @@ -834,10 +842,12 @@ private Deployment getDeploymentContent() { final PackageType packageType = PackageType.resolve(project); final String filename = String.format("%s.%s", project.getBuild() .getFinalName(), packageType.getFileExtension()); + String runtimeName = this.name == null || this.name.isBlank() ? filename : this.name; if (remote) { return Deployment.of(Path.of(project.getBuild().getDirectory()).resolve(filename)); } else { - return Deployment.of(resolveWarDir()).setRuntimeName(filename); + + return Deployment.of(resolveWarDir()).setName(runtimeName).setRuntimeName(runtimeName); } }