Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WFMP-208]: dev mode deployment runtime name is not configurable. #350

Merged
merged 1 commit into from
Jun 28, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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