session.getExecutionProperties().putAll(phaseCall.getProperties());
//project.getProperties().putAll(commandCall.getProperties());
session.setCurrentProject(currentProject);
session.getSettings().setOffline(phaseCall.isOffline() ? true : pluginExecutionOfflineMode);
ProfileManager profileManager = new DefaultProfileManager(session.getContainer(), phaseCall.getProperties());
profileManager.explicitlyActivate(phaseCall.getProfiles());
Settings settings = session.getSettings();
Class<DefaultMavenExecutionRequest> merClass = DefaultMavenExecutionRequest.class;
Constructor[] ctrs = merClass.getConstructors();
MavenExecutionRequest request = null;
Method pomMethod = null;
if(ctrs[0].getParameterTypes().length < 1)
{
request = merClass.newInstance();
request.setLocalRepository(session.getLocalRepository())
.setOffline( session.isOffline() )
.setRemoteRepositories(project.getRemoteArtifactRepositories())
.setPluginArtifactRepositories(project.getPluginArtifactRepositories())
.setInteractiveMode( settings.isInteractiveMode() )
.setProxies( settings.getProxies() )
.setServers( settings.getServers() )
.setMirrors( settings.getMirrors() )
.setPluginGroups( session.getPluginGroups() )
.setGoals( phaseCall.getPhases() )
.setSystemProperties( session.getSystemProperties() )
.setUserProperties( session.getUserProperties() )
.setActiveProfiles( profileManager.getActiveProfiles() );
pomMethod = request.getClass().getMethod("setPom",File.class);
pomMethod.invoke(request,new File(currentProject.getBasedir(), "pom.xml"));
}
else