@DefaultCommand public void run(PipeOut out) { forge.about(out); } }
return; Dependency forgeDistribution = getLatestAvailableDistribution(); if (forgeDistribution == null) if (prompt.promptBoolean("Is that ok ?", true)) updateForge(forgeDistribution);
@Command(value = "source-plugin", help = "Install a plugin from a local project folder") public void installFromLocalProject( @Option(description = "project directory", required = true) final Resource<?> projectFolder, @Option(name = "coordinates", type = PromptType.DEPENDENCY_ID, description = "the coordinates for the plugin (if in a multi-module repository)") final Dependency coordinates, final PipeOut out) throws Exception { DirectoryResource workspace = projectFolder.reify(DirectoryResource.class); if ((workspace == null) || !workspace.exists()) { throw new IllegalArgumentException("Project folder must be specified."); } pluginManager.installFromProject(workspace, coordinates); ShellMessages.success(out, "Installed from [" + workspace + "] successfully."); restart(); }
@Command(value = "install-plugin", help = "Installs a plugin from the configured Forge plugin index") public void installFromIndex( @Option(description = "plugin-name", completer = IndexPluginNameCompleter.class, required = true) final String pluginName, @Option(name = "version", description = "branch, tag, or version to build") final String version, final PipeOut out) throws Exception { PluginRef plugin = PluginUtil.findPluginByName(shell, configuration, pluginName, true); if (plugin == null) { throw new RuntimeException("no plugin found with name [" + pluginName + "]"); } else { ShellMessages.info(out, "Preparing to install plugin: " + plugin.getName()); if (plugin.isGit()) { installFromGit(plugin.getGitRepo(), Strings.isNullOrEmpty(version) ? plugin.getGitRef() : version, null, false, plugin.getArtifact(), out); } else { throw new UnsupportedOperationException("Not yet implemented"); } } }
@Command(value = "remove-plugin", help = "Removes a plugin from the current Forge runtime configuration") public void removePlugin( @Option(completer = InstalledPluginCompleter.class, description = "plugin-name", required = true, help = "The fully qualified plugin name e.g: 'org.jboss.forge.plugin:version'") final String pluginName, final PipeOut out) throws Exception { if (pluginManager.removePlugin(pluginName)) { ShellMessages.success(out, "Successfully removed [" + pluginName + "]"); restart(); } else { ShellMessages.error(out, "Failed to remove [" + pluginName + ""); } }