Code review comment: In this case, we would like a matching extension (if found) to be added as a `forcedDependency`.  For example in any quarkus project the following should always work:  ```sh mvn quarkus:deploy -Dquarkus.deploy.target=knative mvn quarkus:deploy -Dquarkus.deploy.target=openshift ``` Besides the hard coding approach which is what was originally used, I can think of two approaches that could possibly work:  1. Express deployment capabilites in the extension metadata and perform a registry lookup. 2. Use a convention like adding `quarkus-${quarkus.deploy.target|` to forced dependencies.  **Option 1**: has the downsides that its slow. **Option 2**: is not the most reliable (e.g. in the existing codebase knative would still not work as there is no `quarkus-knative` extension).      

Code before review:
protected void doExecute() throws MojoExecutionException {
try (CuratedApplication curatedApplication = bootstrapApplication()) {
AtomicReference<List<String>> tooMany = new AtomicReference<>();
AugmentAction action = curatedApplication.createAugmentor();
action.performCustomBuild(DeployCommandDeclarationHandler.class.getName(), new Consumer<List<String>>() {
@Override
public void accept(List<String> strings) {
tooMany.set(strings);
}
}, DeployCommandDeclarationResultBuildItem.class.getName());
String target = System.getProperty("quarkus.deploy.target");
List<String> targets = tooMany.get();
if (targets.isEmpty() && target == null) {
systemProperties = new HashMap<>(systemProperties);
boolean shouldBuildImage = imageBuild || imageBuilder != null && !imageBuilder.isEmpty();
systemProperties.put("quarkus." + getDeployer().name() + ".deploy", "true");
systemProperties.put("quarkus.container-image.build", String.valueOf(shouldBuildImage));
super.doExecute();
} else if (targets.size() > 1 && target == null) {
getLog().error(
"Too many installed extensions support quarkus:deploy.  You must choose one by setting quarkus.deploy.target.");
getLog().error("Extensions: " + targets.stream().collect(Collectors.joining(" ")));
} else if (target != null && !targets.contains(target)) {
getLog().error(
"Unknown quarkus.deploy.target: " + target);
getLog().error("Extensions: " + targets.stream().collect(Collectors.joining(" ")));
} else {
forceDependencies = false;
if (target == null) {
target = targets.get(0);
}
AugmentAction deployAction = curatedApplication.createAugmentor();
getLog().info("Deploy target: " + target);
System.setProperty("quarkus.deploy.target", target);
deployAction.performCustomBuild(DeployCommandHandler.class.getName(), new Consumer<Boolean>() {
@Override
public void accept(Boolean success) {
}
}, DeployCommandActionResultBuildItem.class.getName());
}
} finally {
}
}

Line under review: getLog().error(

Code after addressing the review:
protected void doExecute() throws MojoExecutionException {
try (CuratedApplication curatedApplication = bootstrapApplication()) {
AtomicReference<List<String>> tooMany = new AtomicReference<>();
AugmentAction action = curatedApplication.createAugmentor();
action.performCustomBuild(DeployCommandDeclarationHandler.class.getName(), new Consumer<List<String>>() {
@Override
public void accept(List<String> strings) {
tooMany.set(strings);
}
}, DeployCommandDeclarationResultBuildItem.class.getName());
String target = System.getProperty("quarkus.deploy.target");
List<String> targets = tooMany.get();
if (targets.isEmpty() && target == null) {
systemProperties = new HashMap<>(systemProperties);
boolean shouldBuildImage = imageBuild || imageBuilder != null && !imageBuilder.isEmpty();
systemProperties.put("quarkus." + getDeployer().name() + ".deploy", "true");
systemProperties.put("quarkus.container-image.build", String.valueOf(shouldBuildImage));
super.doExecute();
} else if (targets.size() > 1 && target == null) {
getLog().error(
"Too many installed extensions support quarkus:deploy.  You must choose one by setting quarkus.deploy.target.");
getLog().error("Extensions: " + targets.stream().collect(Collectors.joining(" ")));
} else if (target != null && !targets.contains(target)) {
getLog().error(
"Unknown quarkus.deploy.target: " + target);
getLog().error("Extensions: " + targets.stream().collect(Collectors.joining(" ")));
} else {
forceDependencies = false;
if (target == null) {
target = targets.get(0);
}
AugmentAction deployAction = curatedApplication.createAugmentor();
getLog().info("Deploy target: " + target);
System.setProperty("quarkus.deploy.target", target);
deployAction.performCustomBuild(DeployCommandHandler.class.getName(), new Consumer<Boolean>() {
@Override
public void accept(Boolean success) {
}
}, DeployCommandActionResultBuildItem.class.getName());
}
} finally {
}
}