@Override
    public final void execute() throws MojoExecutionException {
        try {
            // Expensive construction of ClassLoader
            setProjectClassLoader(buildProjectClassLoader());
            executeInternal();
        } catch (MojoExecutionException e) {
            throw e;
        } catch (Exception e) {
            throw new MojoExecutionException(e.getMessage(), e);
        } finally {
            projectClassLoader = null; // Eagerly discard in the case of FAE semantics
        }
    }
@Test
    public void shouldAddCompilationRootsByDefault() throws Exception {
        AbstractSourceGeneratorMojo mojo = createGeneratorMojo();
        assumeTrue(mojo != null, "Ignored because createGeneratorMojo is not implemented");
        // Differentiate target folders to simplify assertion
        mojo.generatedSrcDir = new File(OUT_DIR.replace("-test-", ""));
        mojo.generatedTestDir = new File(OUT_DIR);
        mojo.execute();

        assertCompileSourceRoots(mojo.project::getCompileSourceRoots, mojo.generatedSrcDir);
        assertCompileSourceRoots(mojo.project::getTestCompileSourceRoots, mojo.generatedTestDir);
    }