@Test void extendFamily(@TempDir final File temporaryFolder) throws Exception { final File pluginFolder = new File(temporaryFolder, "test-plugins_" + UUID.randomUUID().toString()); pluginFolder.mkdirs(); final File transitive = pluginGenerator .createPluginAt(new File(new File("target/test-dependencies"), "org/talend/test/transitive/1.0.0/transitive-1.0.0.jar"), jar -> { try { jar.write(pluginGenerator.createProcessor(jar, "org/test2", "second")); jar.write(pluginGenerator.createModel(jar, "org/test2")); } catch (final IOException e) { fail(e.getMessage()); } }, "org.apache.tomee:openejb-itests-beans:jar:7.0.5:runtime"); final File plugin2 = pluginGenerator.createPlugin(pluginFolder, "main.jar", "org.talend.test:transitive:1.0.0"); try (final ComponentManager manager = newManager()) { try { manager.addPlugin(plugin2.getAbsolutePath()); final Container container = validateTransitiveComponent(manager); final String[] dependencies = Stream .of(container.getLoader().getURLs()) .map(Files::toFile) .map(File::getName) .sorted() .toArray(String[]::new); assertEquals(2, dependencies.length); assertEquals("main.jar", dependencies[0]); assertEquals("transitive-1.0.0.jar", dependencies[1]); } finally { if (!transitive.delete()) { transitive.deleteOnExit(); } } } finally { doCleanup(pluginFolder); } }
public synchronized String addPlugin(final String pluginRootFile) { final Optional<Container> pl = findPlugin(pluginRootFile); if (pl.isPresent()) { return pl.get().getId(); } final String id = this.container .builder(pluginRootFile) .withCustomizer(createContainerCustomizer(pluginRootFile)) .withAdditionalClasspath(findAdditionalClasspathFor(container.buildAutoIdFromName(pluginRootFile))) .create() .getId(); info("Adding plugin: " + pluginRootFile + ", as " + id); return id; }
ComponentManager implements AutoCloseable { public synchronized String addPlugin(final String pluginRootFile) { final Optional<Container> pl = findPlugin(pluginRootFile); if (pl.isPresent()) { return pl.get().getId(); } final String id = this.container .builder(pluginRootFile) .withCustomizer(createContainerCustomizer(pluginRootFile)) .withAdditionalClasspath(findAdditionalClasspathFor(container.buildAutoIdFromName(pluginRootFile))) .create() .getId(); info("Adding plugin: " + pluginRootFile + ", as " + id); return id; } }
ComponentManager implements AutoCloseable { public synchronized String addPlugin(final String pluginRootFile) { final Optional<Container> pl = findPlugin(pluginRootFile); if (pl.isPresent()) { return pl.get().getId(); } final String id = this.container .builder(pluginRootFile) .withCustomizer(createContainerCustomizer(pluginRootFile)) .withAdditionalClasspath(findAdditionalClasspathFor(container.buildAutoIdFromName(pluginRootFile))) .create() .getId(); info("Adding plugin: " + pluginRootFile + ", as " + id); return id; } ComponentManager(final File m2);  ComponentManager(final File m2, final String dependenciesResource, final String jmxNamePattern);  ComponentManager(final Path m2);  ComponentManager(final Path m2, final String dependenciesResource, final String jmxNamePattern); }
ComponentManager implements AutoCloseable { public synchronized String addPlugin(final String pluginRootFile) { final Optional<Container> pl = findPlugin(pluginRootFile); if (pl.isPresent()) { return pl.get().getId(); } final String id = this.container .builder(pluginRootFile) .withCustomizer(createContainerCustomizer(pluginRootFile)) .withAdditionalClasspath(findAdditionalClasspathFor(container.buildAutoIdFromName(pluginRootFile))) .create() .getId(); info("Adding plugin: " + pluginRootFile + ", as " + id); return id; } ComponentManager(final File m2);  ComponentManager(final File m2, final String dependenciesResource, final String jmxNamePattern);  ComponentManager(final Path m2);  ComponentManager(final Path m2, final String dependenciesResource, final String jmxNamePattern); static ComponentManager instance(); static Path findM2(); void addCallerAsPlugin(); Stream<T> find(final Function<Container, Stream<T>> mapper); Optional<Object> createComponent(final String plugin, final String name, final ComponentType componentType,
            final int version, final Map<String, String> configuration); void autoDiscoverPlugins(final boolean callers, final boolean classpath); Optional<Mapper> findMapper(final String plugin, final String name, final int version,
            final Map<String, String> configuration); Optional<org.talend.sdk.component.runtime.output.Processor> findProcessor(final String plugin,
            final String name, final int version, final Map<String, String> configuration); boolean hasPlugin(final String plugin); Optional<Container> findPlugin(final String plugin); synchronized String addPlugin(final String pluginRootFile); String addWithLocationPlugin(final String location, final String pluginRootFile); void removePlugin(final String id); @Override void close(); List<String> availablePlugins(); }
ComponentManager implements AutoCloseable { public synchronized String addPlugin(final String pluginRootFile) { final Optional<Container> pl = findPlugin(pluginRootFile); if (pl.isPresent()) { return pl.get().getId(); } final String id = this.container .builder(pluginRootFile) .withCustomizer(createContainerCustomizer(pluginRootFile)) .withAdditionalClasspath(findAdditionalClasspathFor(container.buildAutoIdFromName(pluginRootFile))) .create() .getId(); info("Adding plugin: " + pluginRootFile + ", as " + id); return id; } ComponentManager(final File m2);  ComponentManager(final File m2, final String dependenciesResource, final String jmxNamePattern);  ComponentManager(final Path m2);  ComponentManager(final Path m2, final String dependenciesResource, final String jmxNamePattern); static ComponentManager instance(); static Path findM2(); void addCallerAsPlugin(); Stream<T> find(final Function<Container, Stream<T>> mapper); Optional<Object> createComponent(final String plugin, final String name, final ComponentType componentType,
            final int version, final Map<String, String> configuration); void autoDiscoverPlugins(final boolean callers, final boolean classpath); Optional<Mapper> findMapper(final String plugin, final String name, final int version,
            final Map<String, String> configuration); Optional<org.talend.sdk.component.runtime.output.Processor> findProcessor(final String plugin,
            final String name, final int version, final Map<String, String> configuration); boolean hasPlugin(final String plugin); Optional<Container> findPlugin(final String plugin); synchronized String addPlugin(final String pluginRootFile); String addWithLocationPlugin(final String location, final String pluginRootFile); void removePlugin(final String id); @Override void close(); List<String> availablePlugins();  }