/** * Simply calls {@AbstractAnalysisGoal#execute}. * * CAN be overridden by subclasses. * @return */ protected void executeGoal() throws Exception { this.goal.executeSync(); } }
/** * 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 ); } }
/** * All {@link Space}-related goals need to have a tenant configured. * @throws GoalConfigurationException if no tenant is specified */ protected void checkPreconditions() throws GoalConfigurationException { if(!this.getGoalContext().hasTenant()) throw new GoalConfigurationException("No tenant configured"); }
protected void updateFromConfig(Space _s) { final Configuration c = this.getConfiguration().getConfiguration(); _s.setSpaceName(c.getString(CoreConfiguration.SPACE_NAME, null)); _s.setSpaceDescription(c.getString(CoreConfiguration.SPACE_DESCR, null)); _s.setExportConfiguration(ExportConfiguration.parse(c.getString(CoreConfiguration.SPACE_EXPCFG, "AGGREGATED"))); _s.setPublic(c.getBoolean(CoreConfiguration.SPACE_PUBLIC, true)); _s.setBugFilter(c.getInt(CoreConfiguration.SPACE_BUGFLT, -1)); _s.setOwnerEmails(new HashSet<String>(Arrays.asList(c.getStringArray(CoreConfiguration.SPACE_OWNERS)))); } }