Source:
<code>protected void doExecute() throws Exception { if (skip) { return; } checkServerHomeExists(); checkServerDirectoryExists(); UndeployTask undeployTask = (UndeployTask) ant .createTask("antlib:net/wasdev/wlp/ant:undeploy"); if (undeployTask == null) { <START> throw new IllegalStateException("Undeploy task not found"); <END> } if (appArchive != null || appArtifact != null) { if (appArchive != null && appArtifact != null) { throw new MojoExecutionException( messages.getString("error.app.set.twice")); } if (appArtifact != null) { Artifact artifact = getArtifact(appArtifact); appArchive = artifact.getFile().getName(); log.info(MessageFormat.format( messages.getString("info.variable.set"), "artifact based application", appArtifact)); } else if (appArchive != null) { File file = new File(appArchive); if (file.exists()) { appArchive = file.getName(); } log.info(MessageFormat.format( messages.getString("info.variable.set"), "non-artifact based application", appArchive)); } File destFile = new File(serverDirectory, "dropins/" + appArchive); if (destFile == null || !destFile.exists() || destFile.isDirectory()) { throw new IOException(MessageFormat.format( messages.getString("error.undeploy.app.noexist"), destFile.getCanonicalPath())); } undeployTask.setFile(appArchive); log.info(MessageFormat.format( messages.getString("info.undeploy.app"), destFile.getCanonicalPath())); } else if (patternSet != null && patternSet.hasPatterns(ant.getAnt())) { log.info(messages.getString("info.undeploy.patternset")); undeployTask.addPatternset(patternSet); } else { log.info(messages.getString("info.undeploy.all")); } undeployTask.setInstallDir(installDirectory); undeployTask.setServerName(serverName); undeployTask.setUserDir(userDirectory); undeployTask.setOutputDir(outputDirectory); undeployTask.setTimeout(Long.toString(timeout * 1000)); undeployTask.execute(); }</code><technical_language>pattern here, good add this messages file as: Liberty {0} Ant task found. Verify required version of wlp-anttasks.jar is available. call MessageFormat.format method message key task name</technical_language>

Target:
protected void doExecute() throws Exception { if (skip) { return; } checkServerHomeExists(); checkServerDirectoryExists(); UndeployTask undeployTask = (UndeployTask) ant .createTask("antlib:net/wasdev/wlp/ant:undeploy"); if (undeployTask == null) { throw new IllegalStateException(MessageFormat.format(messages.getString("error.dependencies.not.found"), "undeploy")); } if (appArchive != null || appArtifact != null) { if (appArchive != null && appArtifact != null) { throw new MojoExecutionException( messages.getString("error.app.set.twice")); } if (appArtifact != null) { Artifact artifact = getArtifact(appArtifact); appArchive = artifact.getFile().getName(); log.info(MessageFormat.format( messages.getString("info.variable.set"), "artifact based application", appArtifact)); } else if (appArchive != null) { File file = new File(appArchive); if (file.exists()) { appArchive = file.getName(); } log.info(MessageFormat.format( messages.getString("info.variable.set"), "non-artifact based application", appArchive)); } File destFile = new File(serverDirectory, "dropins/" + appArchive); if (destFile == null || !destFile.exists() || destFile.isDirectory()) { throw new IOException(MessageFormat.format( messages.getString("error.undeploy.app.noexist"), destFile.getCanonicalPath())); } undeployTask.setFile(appArchive); log.info(MessageFormat.format( messages.getString("info.undeploy.app"), destFile.getCanonicalPath())); } else if (patternSet != null && patternSet.hasPatterns(ant.getAnt())) { log.info(messages.getString("info.undeploy.patternset")); undeployTask.addPatternset(patternSet); } else { log.info(messages.getString("info.undeploy.all")); } undeployTask.setInstallDir(installDirectory); undeployTask.setServerName(serverName); undeployTask.setUserDir(userDirectory); undeployTask.setOutputDir(outputDirectory); undeployTask.setTimeout(Long.toString(timeout * 1000)); undeployTask.execute(); }