summaryrefslogtreecommitdiffstats
path: root/vespa-maven-plugin
diff options
context:
space:
mode:
authorJon Marius Venstad <venstad@gmail.com>2020-10-27 21:34:53 +0100
committerJon Marius Venstad <venstad@gmail.com>2020-10-27 21:34:53 +0100
commit456b4f98cfa576c63380913022f3f7d43d033dde (patch)
treea3f0298ec2fcdbdfdd64facf7fea48e553af40e1 /vespa-maven-plugin
parent4d5f1ce293c680be6a0050a0a1606a902003465d (diff)
Throw more verbose exceptions, and avoid compile-version, in deploy
Diffstat (limited to 'vespa-maven-plugin')
-rw-r--r--vespa-maven-plugin/src/main/java/ai/vespa/hosted/plugin/AbstractVespaMojo.java2
-rw-r--r--vespa-maven-plugin/src/main/java/ai/vespa/hosted/plugin/DeployMojo.java11
2 files changed, 2 insertions, 11 deletions
diff --git a/vespa-maven-plugin/src/main/java/ai/vespa/hosted/plugin/AbstractVespaMojo.java b/vespa-maven-plugin/src/main/java/ai/vespa/hosted/plugin/AbstractVespaMojo.java
index 137bee54b8f..8cfbfd204ba 100644
--- a/vespa-maven-plugin/src/main/java/ai/vespa/hosted/plugin/AbstractVespaMojo.java
+++ b/vespa-maven-plugin/src/main/java/ai/vespa/hosted/plugin/AbstractVespaMojo.java
@@ -61,7 +61,7 @@ public abstract class AbstractVespaMojo extends AbstractMojo {
throw e;
}
catch (Exception e) {
- throw new MojoExecutionException("Execution failed for application " + name() + ":", e);
+ throw new MojoExecutionException("Execution failed for application " + name(), e);
}
}
diff --git a/vespa-maven-plugin/src/main/java/ai/vespa/hosted/plugin/DeployMojo.java b/vespa-maven-plugin/src/main/java/ai/vespa/hosted/plugin/DeployMojo.java
index 69d4d6001d0..3ca628cdc84 100644
--- a/vespa-maven-plugin/src/main/java/ai/vespa/hosted/plugin/DeployMojo.java
+++ b/vespa-maven-plugin/src/main/java/ai/vespa/hosted/plugin/DeployMojo.java
@@ -38,19 +38,10 @@ public class DeployMojo extends AbstractVespaDeploymentMojo {
@Override
protected void doExecute() throws MojoFailureException, MojoExecutionException {
- try {
- controller.compileVersion(id);
- }
- catch (IllegalArgumentException e) {
- throw new MojoFailureException( "The application " + id.tenant() + "." + id.application() + " does not exist, "
- + "or you do not have the required privileges to access it; "
- + "please visit the Vespa cloud web UI and make sure the application exists and you have access!");
- }
-
loggable = DeploymentLog.Level.valueOf(vespaLogLevel);
Deployment deployment = Deployment.ofPackage(Paths.get(firstNonBlank(applicationZip,
projectPathOf("target", "application.zip"))));
- if (!isNullOrBlank(vespaVersion)) deployment = deployment.atVersion(vespaVersion);
+ if ( ! isNullOrBlank(vespaVersion)) deployment = deployment.atVersion(vespaVersion);
ZoneId zone = zoneOf(environment, region);
DeploymentResult result = controller.deploy(deployment, id, zone);