mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-17 10:41:06 +01:00
implemented optional dependencies
Plugin authors could now define optional dependencies to other plugins in their pom. Extensions which are using classes from optional dependencies must specify this with the "requires" attribute of the extension annotation. Extensions with "requires" attribute are not installed if one of the specified plugins, is not installed.
This commit is contained in:
@@ -49,4 +49,15 @@ import java.lang.annotation.Target;
|
||||
@Target({ ElementType.TYPE })
|
||||
@PluginAnnotation("extension")
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface Extension {}
|
||||
public @interface Extension {
|
||||
/**
|
||||
* List of required plugins to load this extension.
|
||||
* The requires attribute can be used to implement optional extensions.
|
||||
* A plugin author is able to implement an extension point of an optional plugin and the extension is only loaded if
|
||||
* all of the specified plugins are installed.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @return list of required plugins to load this extension
|
||||
*/
|
||||
String[] requires() default {};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user