void (final Module module, final @Nullable String mainClassName, final @Nullable String directoryForManifest, final boolean extractLibrariesToJar, final boolean includeTests) { final JarFromModulesTemplate template = new JarFromModulesTemplate(getContext()); final Module[] modules = module != null ? new Module[]{module} : ModuleManager.getInstance(getProject()).getModules(); final ArtifactTemplate.NewArtifactConfiguration configuration = template.doCreateArtifact(modules, mainClassName, directoryForManifest, extractLibrariesToJar, includeTests); assertNotNull(configuration); myArtifact = addArtifact(configuration.getArtifactName(), configuration.getArtifactType(), configuration.getRootElement()); }