refactor(core): migrate to standard Java ServiceLoader for plugins

Changes:
- add new top level interface `Plugin`
- add new `JsonDeserializer` aware of the `PluginRegistry`
- add new annotation processor for plugin
- migrate to hibernate-validator for the JSR-303 (no bean introspection dependencies)
- update all Validation annotations to be complitant with the JSR-303
- remove all KestraApplicationContext stuffs
- fix some tests

part-of: kestra-io/plugin-template-test#25
part-of: kestra-io/plugin-serdes#103
This commit is contained in:
Florian Hussonnois
2024-04-15 12:40:28 +02:00
committed by Florian Hussonnois
parent 65d7e7c949
commit 56884d5a72
101 changed files with 1437 additions and 777 deletions

View File

@@ -1,5 +1,7 @@
dependencies {
annotationProcessor project(":processor")
implementation project(":core")
testAnnotationProcessor project(":processor")
testImplementation project(':core').sourceSets.test.output
}

View File

@@ -1,5 +1,6 @@
package io.kestra.storage.local;
import io.kestra.core.models.annotations.Plugin;
import io.kestra.core.storages.FileAttributes;
import io.kestra.core.storages.StorageInterface;
import jakarta.inject.Inject;
@@ -18,11 +19,17 @@ import java.util.stream.Stream;
import static io.kestra.core.utils.Rethrow.throwFunction;
@Plugin
@Singleton
@LocalStorageEnabled
public class LocalStorage implements StorageInterface {
LocalConfig config;
/**
* No-arg constructor - required by Kestra service loader.
*/
public LocalStorage() {}
@Inject
public LocalStorage(LocalConfig config) throws IOException {
this.config = config;