IMaven maven = MavenPlugin.getMaven();
// first get the plexus container
PlexusContainer container = ((MavenImpl) MavenPlugin.getMaven()).getPlexusContainer();
// then get the DefaultMaven
DefaultMaven mvn = (DefaultMaven) container.lookup(Maven.class);
// now create a RepositorySystemSession
MavenExecutionRequest request = new DefaultMavenExecutionRequest();
request.setLocalRepository(maven.getLocalRepository());