public void execute() throws MojoExecutionException, MojoFailureException { try { String infoFile = baseDir + File.separator + Constants.LOAD_TEST_INFO_FILE; if (isGoalAvailable(infoFile, LOAD_TEST) && getDependency(infoFile, LOAD_TEST) != null) { PhrescoPlugin plugin = getPlugin(getDependency(infoFile, LOAD_TEST)); plugin.runLoadTest(getConfiguration(infoFile, LOAD_TEST), getMavenProjectInfo(project)); } else { PhrescoPlugin plugin = new PhrescoBasePlugin(getLog()); plugin.runLoadTest(getConfiguration(infoFile, LOAD_TEST), getMavenProjectInfo(project)); } } catch (PhrescoException e) { throw new MojoExecutionException(e.getMessage(), e); } }
private void deploy() throws MojoExecutionException { String deployLocation = ""; try { List<com.photon.phresco.configuration.Configuration> configuration = pUtil.getConfiguration(baseDir, environmentName, Constants.SETTINGS_TEMPLATE_SERVER); for (com.photon.phresco.configuration.Configuration config : configuration) { deployLocation = config.getProperties().getProperty(Constants.SERVER_DEPLOY_DIR); break; } File deployDir = new File(deployLocation); if (!deployDir.exists()) { throw new MojoExecutionException("Deploy Directory" + deployLocation + " Does Not Exists "); } log.info("Project is deploying into " + deployLocation); FileUtils.copyDirectoryStructure(tempDir.getParentFile(), deployDir); log.info("Project is deployed successfully"); } catch (PhrescoException e) { throw new MojoExecutionException(e.getMessage(), e); } catch (IOException e) { throw new MojoExecutionException(e.getMessage(), e); } }