Skip to content

Commit

Permalink
[WFMP-208]: dev mode deployment runtime name is not configurable.
Browse files Browse the repository at this point in the history
* 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 <ehugonne@redhat.com>
  • Loading branch information
ehsavoie committed May 26, 2023
1 parent bbfb55c commit 1b3978c
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion plugin/src/main/java/org/wildfly/plugin/dev/DevMojo.java
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,14 @@ public class DevMojo extends AbstractServerStartMojo {
@Parameter(alias = "channels")
private List<ChannelConfiguration> 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<Pattern> ignoreUpdatePatterns = new ArrayList<>();
// Lazy loaded
Expand Down Expand Up @@ -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);
}
}

Expand Down

0 comments on commit 1b3978c

Please sign in to comment.