AppShellCommand.NewAppCommandRunner appCommandRunner =
new AppShellCommand(new CoreModule().uuidGenerator()).new NewAppCommandRunner();
Path appPath = appCommandRunner.generateApp(descriptor, shell);
Verifier mavenVerifier = new Verifier(appPath.toString());
if (OSUtils.isMacOSX()) {
// on MacOSX, when using the verifier JAVA_HOME is not always properly detected
// sometimes it points to JRE, making javadoc call fail.
// Here is a workaround for that problem
String javaHome = System.getProperty("java.home");
if (javaHome.endsWith("jre")) {
javaHome = new File(javaHome).getParentFile().getCanonicalPath();
mavenVerifier.setEnvironmentVariable("JAVA_HOME", javaHome);
}
}
mavenVerifier.executeGoal("package");
mavenVerifier.verifyErrorFreeLog();
}