app_pip_packs.addAll(pip.getFreezePackages()); } catch (ProcessWrapperException e) { throw new GoalExecutionException("Error creating pip wrapper: " + e.getMessage(), e); } catch (IOException e) { throw new GoalExecutionException("Error creating pip wrapper: " + e.getMessage(), e); } catch (InterruptedException e) { throw new GoalExecutionException("Error creating pip wrapper: " + e.getMessage(), e);
public final void run() { try { this.execute(); } catch (GoalConfigurationException e) { log.error("Error while configuring " + this + ": " + e.getMessage(), e); } catch (GoalExecutionException e) { log.error("Error while executing " + this + ": " + e.getMessage(), e); } }
@Override protected void executeTasks() throws Exception { final Space s = this.getGoalContext().getSpace(); this.updateFromConfig(s); final BackendConnector bc = BackendConnector.getInstance(); // Check that name and description are provided if(!s.hasNameAndDescription()) throw new GoalExecutionException("Space modification requires a name and description, adjust the configuration accordingly", null); // Check that space exists if(!bc.isSpaceExisting(this.getGoalContext(), s)) throw new GoalExecutionException("Space with token [" + s.getSpaceToken() + "] does not exist", null); bc.modifySpace(this.getGoalContext(), s); } }
throw new MojoExecutionException(gee.getMessage(), gee);
@Override protected void executeTasks() throws Exception { final Space s = new Space(); this.updateFromConfig(s); // Warn that any provided space token is ignored when creating a new space if(s.isValidSpaceToken()) log.warn("Upon space creation a new token will be generated, the current token [" + s.getSpaceToken() + "] will be ignored"); // Check that name and description are provided if(!s.hasNameAndDescription()) { this.skipGoalUpload(); throw new GoalExecutionException("Space creation requires name and description, adjust the configuration accordingly", null); } // Create space and print token to be used in configuration this.createdSpace = BackendConnector.getInstance().createSpace(this.getGoalContext(), s); if(this.createdSpace==null) { log.error("Space creation failed"); } else { log.info("Space creation succeeded: Use space token [" + this.createdSpace.spaceToken + "] for configuration setting [" + CoreConfiguration.SPACE_TOKEN + "]"); // Update context so that goal execution is uploaded properly this.getGoalContext().setSpace(this.createdSpace); } }
/** * This method, called by Maven, first invokes {@link AbstractVulasSpaceMojo#createGoal()} and then {@link AbstractVulasSpaceMojo#executeGoal()}. */ public final void execute() throws MojoExecutionException, MojoFailureException { try { this.prepareConfiguration(); // Create the goal this.createGoal(); this.goal.setGoalClient(GoalClient.MAVEN_PLUGIN); this.goal.setConfiguration(VulasConfiguration.getGlobal()); // Execute the goal this.executeGoal(); } // Expected problems will be passed on as is catch (MojoFailureException mfe) { throw mfe; } // Unexpected problems (the goal execution terminates abnormally/unexpectedly) catch (GoalExecutionException gee) { throw new MojoExecutionException(gee.getMessage(), gee); } // Every other exception results in a MojoExecutionException (= unexpected) catch(Exception e) { throw new MojoExecutionException("Error during Vulas goal execution " + this.goal + ": ", e ); } }
@Override protected void executeTasks() throws Exception { final Space s = this.getGoalContext().getSpace(); final BackendConnector bc = BackendConnector.getInstance(); // Check that space exists if(!bc.isSpaceExisting(this.getGoalContext(), s)) throw new GoalExecutionException("Space with token [" + s.getSpaceToken() + "] does not exist", null); bc.deleteSpace(this.getGoalContext(), s); } }
throw new MojoExecutionException(gee.getMessage(), gee);
@Override protected void executeTasks() throws Exception { final Space s = this.getGoalContext().getSpace(); final BackendConnector bc = BackendConnector.getInstance(); // Check that space exists if(!bc.isSpaceExisting(this.getGoalContext(), s)) throw new GoalExecutionException("Space with token [" + s.getSpaceToken() + "] does not exist", null); bc.cleanSpace(this.getGoalContext(), s); } }
private final void execute() throws GoalConfigurationException, GoalExecutionException { // Execute the goal and measure execution time try { this.start(); this.executeTasks(); this.stop(); } // Throw as is catch(GoalConfigurationException gce) { this.stop(gce); this.skipGoalUpload(); // Do not upload in case of configuration problems throw gce; } // Throw as is catch(GoalExecutionException gee) { this.stop(gee); throw gee; } // Embedd in GoalExecutionException catch(Exception e) { this.stop(e); throw new GoalExecutionException(e); } finally { if(this.goalUploadEnabled) this.upload(); } }
report.fetchAppVulnerabilities(); } catch (IOException e) { throw new GoalExecutionException("Error fetching vulnerabilities from the backend: " + e.getMessage(), e);