@Test(expected = MojoFailureException.class)
public void testExecuteWebsterPlan_targetFails() throws Exception {

    final File testOutDir = new File(testOutBaseDir, "testExecuteWebsterPlan_targetFails");
    recursiveDeleteWithRetry(testOutDir);
    final File projectRoot = new File(testOutDir, "content-package");
    FileUtils.copyDirectory(new File(srcDir, "content-package"), projectRoot);
    final WebsterMojo mojo = newMojo();
    final File tempDir = new File(testOutDir, "webster-tmp");
    mojo.websterTempDirectory = tempDir;
    final WebsterPlan.Builder builder = new WebsterPlan.Builder();
    final File segmentStore = new File(testOutDir, "segmentstore");
    builder.withFixtureProvider(() -> JcrFactory.getReadWriteFixture(segmentStore));
    withMockTarget(builder, session -> {
        throw new Exception("Whoops.");
    });
    mojo.executeWebsterPlan(builder);
}