BuildContext buildContext = getBuildContext();
IMavenProjectFacade mproj = getMavenProjectFacade();
IProject proj = mproj.getProject();
proj.refreshLocal(IResource.DEPTH_INFINITE, monitor);
IFile generatedSource = proj.getFile(sourceRoot);
File generatedSourceFolder = generatedSource.getFullPath().toFile();
buildContext.refresh(generatedSourceFolder);
// tell m2e builder to refresh generated files
File generated = maven.getMojoParameterValue(getSession(), getMojoExecution(), sourceRoot, File.class);