Package io.quarkus.cli.plugin
Class PluginManager
- java.lang.Object
-
- io.quarkus.cli.plugin.PluginManager
-
public class PluginManager extends Object
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Optional<Plugin>addPlugin(Plugin plugin)Adds thePluginwith the specified name or location to the installed plugins.Optional<Plugin>addPlugin(Plugin plugin, boolean userCatalog)Adds thePluginwith the specified name or location to the installed plugins.Optional<Plugin>addPlugin(String nameOrLocation)Adds thePluginwith the specified name or location to the installed plugins.Optional<Plugin>addPlugin(String nameOrLocation, boolean userCatalog, Optional<String> description)Adds thePluginwith the specified name or location to the installed plugins.static PluginManagercreate(PluginManagerSettings settings, io.quarkus.devtools.messagewriter.MessageWriter output, Optional<Path> userHome, Optional<Path> currentDir, Supplier<QuarkusProject> quarkusProject)static PluginManagerget()Map<String,Plugin>getInstallablePlugins()Map<String,Plugin>getInstalledPlugins()Map<String,Plugin>getInstalledPlugins(boolean userCatalog)PluginManagerUtilgetUtil()booleanreconcile()Check that the installed plugins are still available in the environment.Optional<Plugin>removePlugin(Plugin plugin)Removes aPluginby name.Optional<Plugin>removePlugin(Plugin plugin, boolean userCatalog)Removes aPluginby name.Optional<Plugin>removePlugin(String name)Removes aPluginby name.Optional<Plugin>removePlugin(String name, boolean userCatalog)Removes aPluginby name.booleansync()Remove unavailable plugins, add extension plugins if available.booleansyncIfNeeded()Optionally sync if needed.
-
-
-
Method Detail
-
get
public static PluginManager get()
-
create
public static PluginManager create(PluginManagerSettings settings, io.quarkus.devtools.messagewriter.MessageWriter output, Optional<Path> userHome, Optional<Path> currentDir, Supplier<QuarkusProject> quarkusProject)
-
addPlugin
public Optional<Plugin> addPlugin(String nameOrLocation)
Adds thePluginwith the specified name or location to the installed plugins. Plugins that have been detected as installable may be added by name. Remote plugins, that are not detected can be added by the location (e.g. url or maven coordinates).- Parameters:
nameOrLocation- The name or location of the plugin.- Returns:
- the pugin that was added wrapped in
Optional, or empty if no plugin was added.
-
addPlugin
public Optional<Plugin> addPlugin(String nameOrLocation, boolean userCatalog, Optional<String> description)
Adds thePluginwith the specified name or location to the installed plugins. Plugins that have been detected as installable may be added by name. Remote plugins, that are not detected can be added by the location (e.g. url or maven coordinates).- Parameters:
nameOrLocation- The name or location of the plugin.userCatalog- Flag to only use the user catalog.description- An optional description to add to the plugin.- Returns:
- The pugin that was added wrapped in
Optional, or empty if no plugin was added.
-
addPlugin
public Optional<Plugin> addPlugin(Plugin plugin)
Adds thePluginwith the specified name or location to the installed plugins. Plugins that have been detected as installable may be added by name. Remote plugins, that are not detected can be added by the location (e.g. url or maven coordinates).- Parameters:
plugin- The plugin.- Returns:
- The pugin that was added wrapped in
Optional, or empty if no plugin was added.
-
addPlugin
public Optional<Plugin> addPlugin(Plugin plugin, boolean userCatalog)
Adds thePluginwith the specified name or location to the installed plugins. Plugins that have been detected as installable may be added by name. Remote plugins, that are not detected can be added by the location (e.g. url or maven coordinates).- Parameters:
plugin- The plugin.userCatalog- Flag to only use the user catalog.- Returns:
- The pugin that was added wrapped in
Optional, or empty if no plugin was added.
-
removePlugin
public Optional<Plugin> removePlugin(String name)
Removes aPluginby name. The catalog from which the plugin will be removed is selected based on where the plugin is found. If plugin is found in both catalogs the project catalog is prefered.- Parameters:
name- The name of the plugin to remove.- Returns:
- The removed plugin wrapped in Optional, empty if no plugin was removed.
-
removePlugin
public Optional<Plugin> removePlugin(String name, boolean userCatalog)
Removes aPluginby name. The catalog from which the plugin will be removed is selected based on where the plugin is found. If plugin is found in both catalogs the project catalog is prefered.- Parameters:
name- The name of the plugin to remove.userCatalog- Flag to only use the user catalog.- Returns:
- The removed plugin wrapped in Optional, empty if no plugin was removed.
-
removePlugin
public Optional<Plugin> removePlugin(Plugin plugin)
Removes aPluginby name. The catalog from which the plugin will be removed is selected based on where the plugin is found. If plugin is found in both catalogs the project catalog is prefered.- Parameters:
plugin- The plugin to remove- Returns:
- The removed plugin wrapped in Optional, empty if no plugin was removed.
-
removePlugin
public Optional<Plugin> removePlugin(Plugin plugin, boolean userCatalog)
Removes aPluginby name. The catalog from which the plugin will be removed is selected based on where the plugin is found. If plugin is found in both catalogs the project catalog is prefered.- Parameters:
plugin- The plugin to removeuserCatalog- Flag to only use the user catalog.- Returns:
- The removed plugin wrapped in Optional, empty if no plugin was removed.
-
reconcile
public boolean reconcile()
Check that the installed plugins are still available in the environment.- Returns:
- true if any catalog was changed.
-
sync
public boolean sync()
Remove unavailable plugins, add extension plugins if available.- Returns:
- true if changes any catalog was modified.
-
syncIfNeeded
public boolean syncIfNeeded()
Optionally sync if needed. Sync happens weekly or when project files are updated.
-
getUtil
public PluginManagerUtil getUtil()
-
-