@Override
    protected void doExecute() throws MojoFailureException, MojoExecutionException {
        loggable = DeploymentLog.Level.valueOf(vespaLogLevel);
        Deployment deployment = Deployment.ofPackage(Paths.get(firstNonBlank(applicationZip,
                                                                             projectPathOf("target", "application.zip"))
                                                                       .orElseThrow())); // Fallback always exists.
        if ( ! isNullOrBlank(vespaVersion)) deployment = deployment.atVersion(vespaVersion);

        ZoneId zone = zoneOf(environment, region);
        DeploymentResult result = controller.deploy(deployment, id, zone);
        getLog().info(result.message());

        if (follow) tailLogs(id, zone, result.run());
    }
Deploys a Vespa application package to the hosted Vespa API.

@author jonmv
vespa-maven-plugin/src/main/java/ai/vespa/hosted/plugin/DeployMojo.java