use of org.jetbrains.idea.maven.execution.MavenExternalExecutor in project intellij-community by JetBrains.
the class ArchetypesTest method testGenerating.
public void testGenerating() throws Exception {
if (!hasMavenInstallation())
return;
File dir = new File(myDir.getPath(), "generated");
dir.mkdirs();
MavenRunnerParameters params = new MavenRunnerParameters(false, dir.getPath(), Arrays.asList("org.apache.maven.plugins:maven-archetype-plugin:RELEASE:generate"), Collections.<String>emptyList());
MavenRunnerSettings settings = new MavenRunnerSettings();
Map<String, String> props = new THashMap<>();
props.put("archetypeGroupId", "org.apache.maven.archetypes");
props.put("archetypeArtifactId", "maven-archetype-quickstart");
props.put("archetypeVersion", "1.0");
props.put("interactiveMode", "false");
props.put("groupId", "foo");
props.put("groupId", "foo");
props.put("artifactId", "bar");
settings.setMavenProperties(props);
MavenExecutor exec;
settings.setJreName(MavenRunnerSettings.USE_INTERNAL_JAVA);
exec = new MavenExternalExecutor(myProject, params, getMavenGeneralSettings(), settings, NULL_MAVEN_CONSOLE);
exec.execute(new EmptyProgressIndicator());
assertTrue(new File(dir, "bar/pom.xml").exists());
}
Aggregations