Skip to content
This repository was archived by the owner on Sep 2, 2025. It is now read-only.
This repository was archived by the owner on Sep 2, 2025. It is now read-only.

Optional plugin dependencies #186

@lefou

Description

@lefou

It would be nice to have optional plugin dependencies.

Use Case:
The new Source Scheme Plugin (https://github.com/SBuild-org/sbuild-sourcescheme-plugin) is capable of providing source jars for arbitrary dependencies. It registeres a "source:" scheme which will be used e.g. by the eclipse plugin to download source jars.

If a user uses e.g. the Aether plugin to provide transitive dependencies with Eclipse Aether (https://github.com/SBuild-org/sbuild-aether-plugin), it would be great, if the Aether plugin would reconfigure the Source Scheme plugin to also support "aether:" dependencies. But, it should also work, if no Source Scheme plugin is present.

What is needed?

  • A way to express optional dependencies. The PluginDependency traits that is used by the PluginWithDependencies trait need another implementation supporting optional plugins.
  • A way to check if a plugin is available. The Plugin object need a new method: def isAvailable(pluginClass: String, version: String): Boolean, whereas the version string might even be a range.
  • Some nice API to only process a plugin, if it is available. I think of a method expecting the name and version of the required plugin and a closure, which requires the available plugin. Of course, the closure will only be loaded, if the plugin is available, avoiding ClassNotFoundErrors and the like.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions