Search in sources :

Example 1 with WebAppPomHandler

use of com.microsoft.azure.maven.webapp.handlers.WebAppPomHandler in project azure-maven-plugins by microsoft.

the class ConfigMojo method doExecute.

@Override
protected void doExecute() throws AzureExecutionException {
    if (!(Utils.isJarPackagingProject(this.project.getPackaging()) || Utils.isEarPackagingProject(this.project.getPackaging()) || Utils.isWarPackagingProject(this.project.getPackaging()))) {
        throw new UnsupportedOperationException(String.format("The project (%s) with packaging %s is not supported for azure app service.", this.project.getName(), this.project.getPackaging()));
    }
    queryer = QueryFactory.getQueryer(settings);
    try {
        pomHandler = new WebAppPomHandler(project.getFile().getAbsolutePath());
        final WebAppConfiguration configuration = pomHandler.getConfiguration() == null ? null : getWebAppConfiguration();
        if (!isV2Configuration(configuration)) {
            Log.warn(CONFIG_ONLY_SUPPORT_V2);
        } else {
            config(configuration);
        }
    } catch (DocumentException | MojoFailureException | IOException | IllegalAccessException e) {
        throw new AzureExecutionException(e.getMessage(), e);
    } finally {
        queryer.close();
    }
}
Also used : WebAppPomHandler(com.microsoft.azure.maven.webapp.handlers.WebAppPomHandler) AzureExecutionException(com.microsoft.azure.toolkit.lib.common.exception.AzureExecutionException) DocumentException(org.dom4j.DocumentException) MojoFailureException(org.apache.maven.plugin.MojoFailureException) IOException(java.io.IOException)

Aggregations

WebAppPomHandler (com.microsoft.azure.maven.webapp.handlers.WebAppPomHandler)1 AzureExecutionException (com.microsoft.azure.toolkit.lib.common.exception.AzureExecutionException)1 IOException (java.io.IOException)1 MojoFailureException (org.apache.maven.plugin.MojoFailureException)1 DocumentException (org.dom4j.DocumentException)1