private void deploy(final SRunningBuild build, StagingPropertiesHelper stagingPropertiesHelper, final TomcatStagingDeploy stagingDeploy) throws IOException { final String baseContext = stagingPropertiesHelper.getBaseContext(); final TomcatManager tomcatManager = createTomcatManager(stagingPropertiesHelper); try { build.getArtifacts(BuildArtifactsViewMode.VIEW_DEFAULT) .iterateArtifacts(new BuildArtifacts.BuildArtifactsProcessor() { @NotNull @Override public Continuation processBuildArtifact(@NotNull BuildArtifact buildArtifact) { if (buildArtifact.getName().endsWith(".war")) { try { deployArtifact(buildArtifact, build, baseContext, tomcatManager, stagingDeploy); } catch (TomcatManagerException | IOException e) { LOGGER.log(Level.SEVERE, e.getMessage(), e); throw new RuntimeException(e); } } return Continuation.CONTINUE; } }); stagingDeploy.setDeployed(true); } catch (Exception e) { stagingDeploy.setDeployed(false); LOGGER.log(Level.SEVERE, e.getMessage(), e); } }