Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package sisu for openSUSE:Factory checked in at 2026-08-29 17:41:25 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/sisu (Old) and /work/SRC/openSUSE:Factory/.sisu.new.1265 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "sisu" Sat Aug 29 17:41:25 2026 rev:19 rq:1374483 version:1.1.0 Changes: -------- --- /work/SRC/openSUSE:Factory/sisu/sisu-extenders.changes 2026-06-27 18:08:02.651922570 +0200 +++ /work/SRC/openSUSE:Factory/.sisu.new.1265/sisu-extenders.changes 2026-08-29 17:42:54.045188681 +0200 @@ -1,0 +2,20 @@ +Wed Jul 29 13:10:03 UTC 2026 - Fridrich Strba <[email protected]> + +- Update to upstream release 1.1.0 + * New feature: JSR330 bean filtering. + + Important: when using Sisu Plexus Shim (that implicitly + creates Sisu Inject), the JSR330 bean filtering will + automatically "follow" (have same filtering rules applied) the + Plexus Beans visibility. Control this behaviour using Plexus + ContainerConfiguration new method + setJSR330ComponentVisibilityFollowsPlexusVisibility(boolean) + + Users of Sisu Inject only (without Plexus Shim) are not + affected by this change. + * Changes + + Update Security Policy + + Build update + + Feat: Ability to filter JSR330 beans based on some predicate + + Update conversion doc + + Introduce more tests for lifecycle + +------------------------------------------------------------------- sisu-mojos.changes: same change sisu.changes: same change Old: ---- sisu-project-1.0.1.tar.gz New: ---- sisu-project-1.1.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ sisu-extenders.spec ++++++ --- /var/tmp/diff_new_pack.vXtIKe/_old 2026-08-29 17:42:55.216230101 +0200 +++ /var/tmp/diff_new_pack.vXtIKe/_new 2026-08-29 17:42:55.217230136 +0200 @@ -18,7 +18,7 @@ %global reltype releases Name: sisu-extenders -Version: 1.0.1 +Version: 1.1.0 Release: 0 Summary: Sisu Extenders License: EPL-1.0 AND EPL-2.0 sisu-mojos.spec: same change ++++++ sisu.spec ++++++ --- /var/tmp/diff_new_pack.vXtIKe/_old 2026-08-29 17:42:55.279232329 +0200 +++ /var/tmp/diff_new_pack.vXtIKe/_new 2026-08-29 17:42:55.280232364 +0200 @@ -18,7 +18,7 @@ %global reltype releases Name: sisu -Version: 1.0.1 +Version: 1.1.0 Release: 0 Summary: Eclipse dependency injection framework License: BSD-3-Clause AND EPL-1.0 AND EPL-2.0 ++++++ _scmsync.obsinfo ++++++ --- /var/tmp/diff_new_pack.vXtIKe/_old 2026-08-29 17:42:55.331234168 +0200 +++ /var/tmp/diff_new_pack.vXtIKe/_new 2026-08-29 17:42:55.334234274 +0200 @@ -1,6 +1,6 @@ -mtime: 1782458983 -commit: 669c5f854ce76aae6e4c0abd74c5ee0a6cd9399f1b172b14baf4fbfd86ab9725 +mtime: 1785330960 +commit: b05568ca64cc88d7143737bfcb4ddad7321c9642db3e11df6be124f213d6251d url: https://src.opensuse.org/java-packages/sisu -revision: 669c5f854ce76aae6e4c0abd74c5ee0a6cd9399f1b172b14baf4fbfd86ab9725 +revision: b05568ca64cc88d7143737bfcb4ddad7321c9642db3e11df6be124f213d6251d projectscmsync: https://src.opensuse.org/java-packages/_ObsPrj ++++++ build.specials.obscpio ++++++ ++++++ build.specials.obscpio ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/.gitignore new/.gitignore --- old/.gitignore 1970-01-01 01:00:00.000000000 +0100 +++ new/.gitignore 2026-07-29 15:16:00.000000000 +0200 @@ -0,0 +1 @@ +.osc ++++++ sisu-build.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/common.xml new/common.xml --- old/common.xml 2026-06-26 09:16:58.992031794 +0200 +++ new/common.xml 2026-07-29 15:08:35.482573049 +0200 @@ -3,7 +3,7 @@ <project name="common" basedir="."> <property file="build.properties"/> - <property name="project.version" value="1.0.1"/> + <property name="project.version" value="1.1.0"/> <property name="project.groupId" value="org.eclipse.sisu"/> <property name="compiler.release" value="8"/> ++++++ sisu-project-1.0.1.tar.gz -> sisu-project-1.1.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sisu-project-releases-1.0.1/SECURITY.md new/sisu-project-releases-1.1.0/SECURITY.md --- old/sisu-project-releases-1.0.1/SECURITY.md 2026-06-24 12:11:18.000000000 +0200 +++ new/sisu-project-releases-1.1.0/SECURITY.md 2026-07-27 18:47:20.000000000 +0200 @@ -1,6 +1,36 @@ # Security Policy -## Reporting a Vulnerability +This Eclipse Foundation Project adheres to the [Eclipse Foundation Vulnerability Reporting Policy](https://www.eclipse.org/security/policy/). -Do not open a public issue to report a security vulnerability. Please send a message to [email protected] and we will create a private issue in which the issue can be triaged and handled. +## How To Report a Vulnerability + +If you think you have found a vulnerability in this repository, please report it to us through coordinated disclosure. + +**Please do not report security vulnerabilities through public issues, discussions, or change requests.** + +Instead, report it using one of the following ways: + +* Create a [confidential issue](https://gitlab.eclipse.org/security/vulnerability-reports/-/issues/new?issuable_template=new_vulnerability) in the Eclipse Foundation Vulnerability Reporting Tracker + +You can find more information about reporting and disclosure at the [Eclipse Foundation Security page](https://www.eclipse.org/security/). + +Please include as much of the information listed below as you can to help us better understand and resolve the issue: + +* The type of issue (e.g., buffer overflow, SQL injection, or cross-site scripting) +* Affected version(s) +* Impact of the issue, including how an attacker might exploit the issue +* Step-by-step instructions to reproduce the issue +* The location of the affected source code (tag/branch/commit or direct URL) +* Full paths of source file(s) related to the manifestation of the issue +* Configuration required to reproduce the issue +* Log files that are related to this issue (if possible) +* Proof-of-concept or exploit code (if possible) + +This information will help us triage your report more quickly. + +## Supported Versions + +Supported versions are: + +* Eclipse Sisu Version 1.0.x diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sisu-project-releases-1.0.1/org.eclipse.sisu.inject/pom.xml new/sisu-project-releases-1.1.0/org.eclipse.sisu.inject/pom.xml --- old/sisu-project-releases-1.0.1/org.eclipse.sisu.inject/pom.xml 2026-06-24 12:11:18.000000000 +0200 +++ new/sisu-project-releases-1.1.0/org.eclipse.sisu.inject/pom.xml 2026-07-27 18:47:20.000000000 +0200 @@ -19,7 +19,7 @@ <parent> <groupId>org.eclipse.sisu</groupId> <artifactId>sisu-inject</artifactId> - <version>1.0.1</version> + <version>1.1.0</version> </parent> <artifactId>org.eclipse.sisu.inject</artifactId> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sisu-project-releases-1.0.1/org.eclipse.sisu.inject/src/main/java/org/eclipse/sisu/inject/DefaultBeanLocator.java new/sisu-project-releases-1.1.0/org.eclipse.sisu.inject/src/main/java/org/eclipse/sisu/inject/DefaultBeanLocator.java --- old/sisu-project-releases-1.0.1/org.eclipse.sisu.inject/src/main/java/org/eclipse/sisu/inject/DefaultBeanLocator.java 2026-06-24 12:11:18.000000000 +0200 +++ new/sisu-project-releases-1.1.0/org.eclipse.sisu.inject/src/main/java/org/eclipse/sisu/inject/DefaultBeanLocator.java 2026-07-27 18:47:20.000000000 +0200 @@ -19,7 +19,10 @@ import com.google.inject.TypeLiteral; import java.util.Map; import java.util.concurrent.ConcurrentMap; +import java.util.concurrent.atomic.AtomicReference; import java.util.concurrent.locks.ReentrantReadWriteLock; +import java.util.function.Predicate; +import java.util.function.Supplier; import javax.inject.Inject; import org.eclipse.sisu.BeanEntry; import org.eclipse.sisu.Mediator; @@ -47,10 +50,19 @@ private final ReentrantReadWriteLock publisherLock = new ReentrantReadWriteLock(); + private final AtomicReference<Supplier<Predicate>> beanEntryPredicateSupplier = new AtomicReference<>(null); + // ---------------------------------------------------------------------- // Public methods // ---------------------------------------------------------------------- + /** + * Sets the predicate supplier for bean entry filtering, may be {@code null}, when no filtering is applied. + */ + public void setBeanEntryPredicateSupplier(Supplier<Predicate> predicateSupplier) { + this.beanEntryPredicateSupplier.set(predicateSupplier); + } + @Override public Iterable<BeanEntry> locate(final Key key) { final TypeLiteral type = key.getTypeLiteral(); @@ -67,7 +79,12 @@ } } final boolean isImplicit = key.getAnnotationType() == null && TypeArguments.isImplicit(type); - return new LocatedBeans(key, bindings, isImplicit ? implicitBindings : null); + LocatedBeans result = new LocatedBeans(key, bindings, isImplicit ? implicitBindings : null); + Supplier<Predicate> predicateSupplier = beanEntryPredicateSupplier.get(); + if (null != predicateSupplier) { + return new FilteredBeans(predicateSupplier, result); + } + return result; } @Override diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sisu-project-releases-1.0.1/org.eclipse.sisu.inject/src/main/java/org/eclipse/sisu/inject/FilteredBeans.java new/sisu-project-releases-1.1.0/org.eclipse.sisu.inject/src/main/java/org/eclipse/sisu/inject/FilteredBeans.java --- old/sisu-project-releases-1.0.1/org.eclipse.sisu.inject/src/main/java/org/eclipse/sisu/inject/FilteredBeans.java 1970-01-01 01:00:00.000000000 +0100 +++ new/sisu-project-releases-1.1.0/org.eclipse.sisu.inject/src/main/java/org/eclipse/sisu/inject/FilteredBeans.java 2026-07-27 18:47:20.000000000 +0200 @@ -0,0 +1,119 @@ +/* + * Copyright (c) 2010-2026 Sonatype, Inc. and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Stuart McCulloch (Sonatype, Inc.) - initial API and implementation + */ +package org.eclipse.sisu.inject; + +import java.lang.annotation.Annotation; +import java.util.Iterator; +import java.util.NoSuchElementException; +import java.util.function.Predicate; +import java.util.function.Supplier; +import org.eclipse.sisu.BeanEntry; + +/** + * Sequence of {@link BeanEntry}s filtered according to supplied {@link java.util.function.Predicate}. + * This class is public, as it is reused in Plexus Shim for realm filtering. + */ +public final class FilteredBeans<Q extends Annotation, T> implements Iterable<BeanEntry<Q, T>> { + // ---------------------------------------------------------------------- + // Implementation fields + // ---------------------------------------------------------------------- + + private final Supplier<Predicate<BeanEntry<Q, T>>> predicateSupplier; + + final Iterable<BeanEntry<Q, T>> beans; + + // ---------------------------------------------------------------------- + // Constructors + // ---------------------------------------------------------------------- + + public FilteredBeans( + final Supplier<Predicate<BeanEntry<Q, T>>> predicateSupplier, final Iterable<BeanEntry<Q, T>> beans) { + this.predicateSupplier = predicateSupplier; + this.beans = beans; + } + + // ---------------------------------------------------------------------- + // Public methods + // ---------------------------------------------------------------------- + + @Override + public Iterator<BeanEntry<Q, T>> iterator() { + final Predicate<BeanEntry<Q, T>> predicate = predicateSupplier != null ? predicateSupplier.get() : null; + if (null != predicate) { + return new FilteredItr(predicate); + } + return beans.iterator(); + } + + // ---------------------------------------------------------------------- + // Implementation types + // ---------------------------------------------------------------------- + + /** + * {@link BeanEntry} iterator that only returns entries allowed by predicate. + */ + final class FilteredItr implements Iterator<BeanEntry<Q, T>> { + // ---------------------------------------------------------------------- + // Implementation fields + // ---------------------------------------------------------------------- + + private final Iterator<BeanEntry<Q, T>> itr = beans.iterator(); + + private final Predicate<BeanEntry<Q, T>> predicate; + + private BeanEntry<Q, T> nextBean; + + // ---------------------------------------------------------------------- + // Constructors + // ---------------------------------------------------------------------- + + public FilteredItr(final Predicate<BeanEntry<Q, T>> predicate) { + this.predicate = predicate; + } + + // ---------------------------------------------------------------------- + // Public methods + // ---------------------------------------------------------------------- + + @Override + public boolean hasNext() { + if (null != nextBean) { + return true; + } + while (itr.hasNext()) { + nextBean = itr.next(); + if (predicate.test(nextBean)) { + return true; + } + } + nextBean = null; + return false; + } + + @Override + public BeanEntry<Q, T> next() { + if (hasNext()) { + // populated by hasNext() + final BeanEntry<Q, T> bean = nextBean; + nextBean = null; + return bean; + } + throw new NoSuchElementException(); + } + + @Override + public void remove() { + throw new UnsupportedOperationException(); + } + } +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sisu-project-releases-1.0.1/org.eclipse.sisu.inject/src/test/java/org/eclipse/sisu/bean/LifecycleManagerJsr250Test.java new/sisu-project-releases-1.1.0/org.eclipse.sisu.inject/src/test/java/org/eclipse/sisu/bean/LifecycleManagerJsr250Test.java --- old/sisu-project-releases-1.0.1/org.eclipse.sisu.inject/src/test/java/org/eclipse/sisu/bean/LifecycleManagerJsr250Test.java 1970-01-01 01:00:00.000000000 +0100 +++ new/sisu-project-releases-1.1.0/org.eclipse.sisu.inject/src/test/java/org/eclipse/sisu/bean/LifecycleManagerJsr250Test.java 2026-07-27 18:47:20.000000000 +0200 @@ -0,0 +1,121 @@ +/* + * Copyright (c) 2010-2024 Sonatype, Inc. and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Stuart McCulloch (Sonatype, Inc.) - initial API and implementation + */ +package org.eclipse.sisu.bean; + +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import javax.annotation.PostConstruct; +import javax.annotation.PreDestroy; +import org.junit.jupiter.api.Test; + +/** + * LifecycleManager test using JSR250 annotations. + */ +class LifecycleManagerJsr250Test { + static class ManagedBean { + boolean started; + + boolean stopped; + + @PostConstruct + void start() { + started = true; + } + + @PreDestroy + void stop() { + stopped = true; + } + } + + static class UnmanagedBean { + // no lifecycle annotations + } + + @Test + void testManageClass() { + final LifecycleManager manager = new LifecycleManager(); + assertTrue(manager.manage(ManagedBean.class)); + assertFalse(manager.manage(UnmanagedBean.class)); + } + + @Test + void testManageProperty() { + final LifecycleManager manager = new LifecycleManager(); + assertNull(manager.manage((BeanProperty<?>) null)); + } + + @Test + void testManageAndActivateBean() { + final LifecycleManager manager = new LifecycleManager(); + manager.manage(ManagedBean.class); + + final ManagedBean bean = new ManagedBean(); + assertTrue(manager.manage(bean)); + assertTrue(bean.started); + } + + @Test + void testUnmanageSpecificBean() { + final LifecycleManager manager = new LifecycleManager(); + manager.manage(ManagedBean.class); + + final ManagedBean bean = new ManagedBean(); + manager.manage(bean); + + assertTrue(manager.unmanage(bean)); + assertTrue(bean.stopped); + } + + @Test + void testUnmanageAll() { + final LifecycleManager manager = new LifecycleManager(); + manager.manage(ManagedBean.class); + + final ManagedBean beanA = new ManagedBean(); + final ManagedBean beanB = new ManagedBean(); + manager.manage(beanA); + manager.manage(beanB); + + assertTrue(manager.unmanage()); + assertTrue(beanA.stopped); + assertTrue(beanB.stopped); + } + + @Test + void testUnmanagedBeanDoesNotFail() { + final LifecycleManager manager = new LifecycleManager(); + final UnmanagedBean bean = new UnmanagedBean(); + assertTrue(manager.manage(bean)); + assertTrue(manager.unmanage(bean)); + } + + @Test + void testFlushCacheFor() { + final LifecycleManager manager = new LifecycleManager(); + manager.manage(ManagedBean.class); + manager.manage(UnmanagedBean.class); + + manager.flushCacheFor(new LifecycleManager.ClassTester() { + @Override + public boolean shouldFlush(final Class<?> clz) { + return clz == ManagedBean.class; + } + }); + + // After flushing, re-managing should re-build the lifecycle + assertTrue(manager.manage(ManagedBean.class)); + } +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sisu-project-releases-1.0.1/org.eclipse.sisu.inject/src/test/java/org/eclipse/sisu/bean/LifecycleManagerTest.java new/sisu-project-releases-1.1.0/org.eclipse.sisu.inject/src/test/java/org/eclipse/sisu/bean/LifecycleManagerTest.java --- old/sisu-project-releases-1.0.1/org.eclipse.sisu.inject/src/test/java/org/eclipse/sisu/bean/LifecycleManagerTest.java 2026-06-24 12:11:18.000000000 +0200 +++ new/sisu-project-releases-1.1.0/org.eclipse.sisu.inject/src/test/java/org/eclipse/sisu/bean/LifecycleManagerTest.java 2026-07-27 18:47:20.000000000 +0200 @@ -16,10 +16,13 @@ import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertTrue; -import javax.annotation.PostConstruct; -import javax.annotation.PreDestroy; +import org.eclipse.sisu.PostConstruct; +import org.eclipse.sisu.PreDestroy; import org.junit.jupiter.api.Test; +/** + * LifecycleManager test using Sisu own annotations. + */ class LifecycleManagerTest { static class ManagedBean { boolean started; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sisu-project-releases-1.0.1/org.eclipse.sisu.inject/src/test/java/org/eclipse/sisu/inject/FilteredBeansTest.java new/sisu-project-releases-1.1.0/org.eclipse.sisu.inject/src/test/java/org/eclipse/sisu/inject/FilteredBeansTest.java --- old/sisu-project-releases-1.0.1/org.eclipse.sisu.inject/src/test/java/org/eclipse/sisu/inject/FilteredBeansTest.java 1970-01-01 01:00:00.000000000 +0100 +++ new/sisu-project-releases-1.1.0/org.eclipse.sisu.inject/src/test/java/org/eclipse/sisu/inject/FilteredBeansTest.java 2026-07-27 18:47:20.000000000 +0200 @@ -0,0 +1,108 @@ +/******************************************************************************* + * Copyright (c) 2010-present Sonatype, Inc. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Stuart McCulloch (Sonatype, Inc.) - initial API and implementation + *******************************************************************************/ +package org.eclipse.sisu.inject; + +import static org.junit.jupiter.api.Assertions.*; + +import com.google.inject.AbstractModule; +import com.google.inject.Binding; +import com.google.inject.Guice; +import com.google.inject.Injector; +import com.google.inject.Key; +import com.google.inject.name.Names; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.function.Predicate; +import javax.inject.Named; +import org.eclipse.sisu.BeanEntry; +import org.eclipse.sisu.inject.RankedBindingsTest.Bean; +import org.eclipse.sisu.inject.RankedBindingsTest.BeanImpl; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +class FilteredBeansTest { + + Injector injector; + + @BeforeEach + void setUp() { + injector = Guice.createInjector(new AbstractModule() { + @Override + protected void configure() { + bind(Bean.class).annotatedWith(Names.named("Marked1")).to(BeanImpl.class); + bind(Bean.class).annotatedWith(Names.named("Marked2")).to(BeanImpl.class); + bind(Bean.class).annotatedWith(Names.named("Marked3")).to(BeanImpl.class); + bind(Bean.class).annotatedWith(Names.named("Marked4")).to(BeanImpl.class); + } + }); + } + + @Test + void withoutSupplier() { + final FilteredBeans<Named, Bean> beans = new FilteredBeans<>(null, locate(Key.get(Bean.class))); + + AtomicInteger count = new AtomicInteger(0); + beans.iterator().forEachRemaining(b -> count.incrementAndGet()); + assertEquals(4, count.get()); + } + + @Test + void withNullSupplier() { + final FilteredBeans<Named, Bean> beans = new FilteredBeans<>(() -> null, locate(Key.get(Bean.class))); + + AtomicInteger count = new AtomicInteger(0); + beans.iterator().forEachRemaining(b -> count.incrementAndGet()); + assertEquals(4, count.get()); + } + + @Test + void withTrueSupplier() { + final FilteredBeans<Named, Bean> beans = new FilteredBeans<>(() -> b -> true, locate(Key.get(Bean.class))); + + AtomicInteger count = new AtomicInteger(0); + beans.iterator().forEachRemaining(b -> count.incrementAndGet()); + assertEquals(4, count.get()); + } + + @Test + void withFalseSupplier() { + final FilteredBeans<Named, Bean> beans = new FilteredBeans<>(() -> b -> false, locate(Key.get(Bean.class))); + + AtomicInteger count = new AtomicInteger(0); + beans.iterator().forEachRemaining(b -> count.incrementAndGet()); + assertEquals(0, count.get()); + } + + @Test + void withFilteringSupplier() { + final Set<String> allowedBeans = new HashSet<>(Arrays.asList("Marked1", "Marked3")); + final Predicate<BeanEntry<Named, Bean>> predicate = + b -> allowedBeans.contains(b.getKey().value()); + final FilteredBeans<Named, Bean> beans = new FilteredBeans<>(() -> predicate, locate(Key.get(Bean.class))); + + AtomicInteger count = new AtomicInteger(0); + beans.iterator().forEachRemaining(b -> { + assertTrue(allowedBeans.contains(b.getKey().value())); + count.incrementAndGet(); + }); + assertEquals(2, count.get()); + } + + private <T> LocatedBeans<Named, T> locate(final Key<T> key) { + final RankedBindings<T> bindings = new RankedBindings<>(key.getTypeLiteral(), null); + for (final Binding<T> b : injector.findBindingsByType(key.getTypeLiteral())) { + bindings.add(b, 0); + } + return new LocatedBeans<>(key, bindings, null); + } +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sisu-project-releases-1.0.1/org.eclipse.sisu.inject.extender/pom.xml new/sisu-project-releases-1.1.0/org.eclipse.sisu.inject.extender/pom.xml --- old/sisu-project-releases-1.0.1/org.eclipse.sisu.inject.extender/pom.xml 2026-06-24 12:11:18.000000000 +0200 +++ new/sisu-project-releases-1.1.0/org.eclipse.sisu.inject.extender/pom.xml 2026-07-27 18:47:20.000000000 +0200 @@ -19,7 +19,7 @@ <parent> <groupId>org.eclipse.sisu</groupId> <artifactId>sisu-inject</artifactId> - <version>1.0.1</version> + <version>1.1.0</version> </parent> <artifactId>org.eclipse.sisu.inject.extender</artifactId> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sisu-project-releases-1.0.1/org.eclipse.sisu.mojos/pom.xml new/sisu-project-releases-1.1.0/org.eclipse.sisu.mojos/pom.xml --- old/sisu-project-releases-1.0.1/org.eclipse.sisu.mojos/pom.xml 2026-06-24 12:11:18.000000000 +0200 +++ new/sisu-project-releases-1.1.0/org.eclipse.sisu.mojos/pom.xml 2026-07-27 18:47:20.000000000 +0200 @@ -19,7 +19,7 @@ <parent> <groupId>org.eclipse.sisu</groupId> <artifactId>sisu-inject</artifactId> - <version>1.0.1</version> + <version>1.1.0</version> </parent> <artifactId>sisu-maven-plugin</artifactId> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sisu-project-releases-1.0.1/org.eclipse.sisu.plexus/pom.xml new/sisu-project-releases-1.1.0/org.eclipse.sisu.plexus/pom.xml --- old/sisu-project-releases-1.0.1/org.eclipse.sisu.plexus/pom.xml 2026-06-24 12:11:18.000000000 +0200 +++ new/sisu-project-releases-1.1.0/org.eclipse.sisu.plexus/pom.xml 2026-07-27 18:47:20.000000000 +0200 @@ -19,7 +19,7 @@ <parent> <groupId>org.eclipse.sisu</groupId> <artifactId>sisu-inject</artifactId> - <version>1.0.1</version> + <version>1.1.0</version> </parent> <artifactId>org.eclipse.sisu.plexus</artifactId> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sisu-project-releases-1.0.1/org.eclipse.sisu.plexus/src/main/java/org/codehaus/plexus/ContainerConfiguration.java new/sisu-project-releases-1.1.0/org.eclipse.sisu.plexus/src/main/java/org/codehaus/plexus/ContainerConfiguration.java --- old/sisu-project-releases-1.0.1/org.eclipse.sisu.plexus/src/main/java/org/codehaus/plexus/ContainerConfiguration.java 2026-06-24 12:11:18.000000000 +0200 +++ new/sisu-project-releases-1.1.0/org.eclipse.sisu.plexus/src/main/java/org/codehaus/plexus/ContainerConfiguration.java 2026-07-27 18:47:20.000000000 +0200 @@ -64,4 +64,8 @@ ContainerConfiguration setStrictClassPathScanning(boolean strictScanning); boolean getStrictClassPathScanning(); + + ContainerConfiguration setJSR330ComponentVisibilityFollowsPlexusVisibility(boolean on); + + boolean getJSR330ComponentVisibilityFollowsPlexusVisibility(); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sisu-project-releases-1.0.1/org.eclipse.sisu.plexus/src/main/java/org/codehaus/plexus/DefaultContainerConfiguration.java new/sisu-project-releases-1.1.0/org.eclipse.sisu.plexus/src/main/java/org/codehaus/plexus/DefaultContainerConfiguration.java --- old/sisu-project-releases-1.0.1/org.eclipse.sisu.plexus/src/main/java/org/codehaus/plexus/DefaultContainerConfiguration.java 2026-06-24 12:11:18.000000000 +0200 +++ new/sisu-project-releases-1.1.0/org.eclipse.sisu.plexus/src/main/java/org/codehaus/plexus/DefaultContainerConfiguration.java 2026-07-27 18:47:20.000000000 +0200 @@ -45,6 +45,8 @@ private boolean strictClassPathScanning; + private boolean jsr330ComponentVisibilityFollowsPlexusVisibility = true; + // ---------------------------------------------------------------------- // Public methods // ---------------------------------------------------------------------- @@ -177,4 +179,15 @@ public boolean getStrictClassPathScanning() { return strictClassPathScanning; } + + @Override + public ContainerConfiguration setJSR330ComponentVisibilityFollowsPlexusVisibility(boolean on) { + this.jsr330ComponentVisibilityFollowsPlexusVisibility = on; + return this; + } + + @Override + public boolean getJSR330ComponentVisibilityFollowsPlexusVisibility() { + return jsr330ComponentVisibilityFollowsPlexusVisibility; + } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sisu-project-releases-1.0.1/org.eclipse.sisu.plexus/src/main/java/org/codehaus/plexus/DefaultPlexusContainer.java new/sisu-project-releases-1.1.0/org.eclipse.sisu.plexus/src/main/java/org/codehaus/plexus/DefaultPlexusContainer.java --- old/sisu-project-releases-1.0.1/org.eclipse.sisu.plexus/src/main/java/org/codehaus/plexus/DefaultPlexusContainer.java 2026-06-24 12:11:18.000000000 +0200 +++ new/sisu-project-releases-1.1.0/org.eclipse.sisu.plexus/src/main/java/org/codehaus/plexus/DefaultPlexusContainer.java 2026-07-27 18:47:20.000000000 +0200 @@ -171,6 +171,12 @@ containerRealm = lookupContainerRealm(configuration); realmManager = new RealmManager(qualifiedBeanLocator); + if (configuration.getJSR330ComponentVisibilityFollowsPlexusVisibility() + && PlexusConstants.REALM_VISIBILITY.equalsIgnoreCase(configuration.getComponentVisibility())) { + // "realm" filtering is enabled for plexus, apply same filter onto JSR330 components too + ((DefaultBeanLocator) qualifiedBeanLocator) + .setBeanEntryPredicateSupplier(realmManager::visibilityPredicate); + } containerRealm.getWorld().addListener(realmManager); componentVisibility = configuration.getComponentVisibility(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sisu-project-releases-1.0.1/org.eclipse.sisu.plexus/src/main/java/org/eclipse/sisu/plexus/DefaultPlexusBeanLocator.java new/sisu-project-releases-1.1.0/org.eclipse.sisu.plexus/src/main/java/org/eclipse/sisu/plexus/DefaultPlexusBeanLocator.java --- old/sisu-project-releases-1.0.1/org.eclipse.sisu.plexus/src/main/java/org/eclipse/sisu/plexus/DefaultPlexusBeanLocator.java 2026-06-24 12:11:18.000000000 +0200 +++ new/sisu-project-releases-1.1.0/org.eclipse.sisu.plexus/src/main/java/org/eclipse/sisu/plexus/DefaultPlexusBeanLocator.java 2026-07-27 18:47:20.000000000 +0200 @@ -22,6 +22,7 @@ import org.codehaus.plexus.PlexusConstants; import org.eclipse.sisu.BeanEntry; import org.eclipse.sisu.inject.BeanLocator; +import org.eclipse.sisu.inject.FilteredBeans; /** * {@link PlexusBeanLocator} that locates beans of various types from zero or more {@link Injector}s. @@ -64,7 +65,7 @@ final Key<T> key = hints.length == 1 ? Key.get(role, Names.named(hints[0])) : Key.get(role, Named.class); Iterable<BeanEntry<Named, T>> beans = (Iterable<BeanEntry<Named, T>>) beanLocator.<Named, T>locate(key); if (PlexusConstants.REALM_VISIBILITY.equalsIgnoreCase(visibility)) { - beans = new RealmFilteredBeans<>(realmManager, beans); + beans = new FilteredBeans<>(realmManager::visibilityPredicate, beans); } return hints.length <= 1 ? new DefaultPlexusBeans<>(beans) : new HintedPlexusBeans<>(beans, role, hints); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sisu-project-releases-1.0.1/org.eclipse.sisu.plexus/src/main/java/org/eclipse/sisu/plexus/RealmFilteredBeans.java new/sisu-project-releases-1.1.0/org.eclipse.sisu.plexus/src/main/java/org/eclipse/sisu/plexus/RealmFilteredBeans.java --- old/sisu-project-releases-1.0.1/org.eclipse.sisu.plexus/src/main/java/org/eclipse/sisu/plexus/RealmFilteredBeans.java 2026-06-24 12:11:18.000000000 +0200 +++ new/sisu-project-releases-1.1.0/org.eclipse.sisu.plexus/src/main/java/org/eclipse/sisu/plexus/RealmFilteredBeans.java 1970-01-01 01:00:00.000000000 +0100 @@ -1,118 +0,0 @@ -/* - * Copyright (c) 2010-2026 Sonatype, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Stuart McCulloch (Sonatype, Inc.) - initial API and implementation - */ -package org.eclipse.sisu.plexus; - -import com.google.inject.name.Named; -import java.util.Iterator; -import java.util.NoSuchElementException; -import java.util.Set; -import org.codehaus.plexus.classworlds.realm.ClassRealm; -import org.eclipse.sisu.BeanEntry; - -/** - * Sequence of {@link BeanEntry}s filtered according to whether they are visible from the current {@link ClassRealm}. - */ -final class RealmFilteredBeans<T> implements Iterable<BeanEntry<Named, T>> { - // ---------------------------------------------------------------------- - // Implementation fields - // ---------------------------------------------------------------------- - - private final RealmManager realmManager; - - final Iterable<BeanEntry<Named, T>> beans; - - // ---------------------------------------------------------------------- - // Constructors - // ---------------------------------------------------------------------- - - RealmFilteredBeans(final RealmManager realmManager, final Iterable<BeanEntry<Named, T>> beans) { - this.realmManager = realmManager; - this.beans = beans; - } - - // ---------------------------------------------------------------------- - // Public methods - // ---------------------------------------------------------------------- - - @Override - public Iterator<BeanEntry<Named, T>> iterator() { - final Set<String> realmNames = realmManager.visibleRealmNames(RealmManager.contextRealm()); - if (null != realmNames && realmNames.size() > 0) { - return new FilteredItr(realmNames); - } - return beans.iterator(); - } - - // ---------------------------------------------------------------------- - // Implementation types - // ---------------------------------------------------------------------- - - /** - * {@link BeanEntry} iterator that only returns entries visible from the given set of named realms. - */ - final class FilteredItr implements Iterator<BeanEntry<Named, T>> { - // ---------------------------------------------------------------------- - // Implementation fields - // ---------------------------------------------------------------------- - - private final Iterator<BeanEntry<Named, T>> itr = beans.iterator(); - - private final Set<String> realmNames; - - private BeanEntry<Named, T> nextBean; - - // ---------------------------------------------------------------------- - // Constructors - // ---------------------------------------------------------------------- - - public FilteredItr(final Set<String> realmNames) { - this.realmNames = realmNames; - } - - // ---------------------------------------------------------------------- - // Public methods - // ---------------------------------------------------------------------- - - @Override - public boolean hasNext() { - if (null != nextBean) { - return true; - } - while (itr.hasNext()) { - nextBean = itr.next(); - final String source = String.valueOf(nextBean.getSource()); - if (!source.startsWith("ClassRealm") || realmNames.contains(source)) { - return true; - } - } - nextBean = null; - return false; - } - - @Override - public BeanEntry<Named, T> next() { - if (hasNext()) { - // populated by hasNext() - final BeanEntry<Named, T> bean = nextBean; - nextBean = null; - return bean; - } - throw new NoSuchElementException(); - } - - @Override - public void remove() { - throw new UnsupportedOperationException(); - } - } -} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sisu-project-releases-1.0.1/org.eclipse.sisu.plexus/src/main/java/org/eclipse/sisu/plexus/RealmManager.java new/sisu-project-releases-1.1.0/org.eclipse.sisu.plexus/src/main/java/org/eclipse/sisu/plexus/RealmManager.java --- old/sisu-project-releases-1.0.1/org.eclipse.sisu.plexus/src/main/java/org/eclipse/sisu/plexus/RealmManager.java 2026-06-24 12:11:18.000000000 +0200 +++ new/sisu-project-releases-1.1.0/org.eclipse.sisu.plexus/src/main/java/org/eclipse/sisu/plexus/RealmManager.java 2026-07-27 18:47:20.000000000 +0200 @@ -13,14 +13,17 @@ package org.eclipse.sisu.plexus; import com.google.inject.Injector; +import java.lang.annotation.Annotation; import java.util.ArrayList; import java.util.HashSet; import java.util.List; import java.util.Set; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; +import java.util.function.Predicate; import org.codehaus.plexus.classworlds.ClassWorldListener; import org.codehaus.plexus.classworlds.realm.ClassRealm; +import org.eclipse.sisu.BeanEntry; import org.eclipse.sisu.inject.InjectorBindings; import org.eclipse.sisu.inject.MutableBeanLocator; @@ -82,6 +85,20 @@ } return null; } + + /** + * Returns {@link Predicate} for realm visibility filtering, or {@code null} if not applicable. + */ + public <Q extends Annotation, T> Predicate<BeanEntry<Q, T>> visibilityPredicate() { + final Set<String> realmNames = visibleRealmNames(contextRealm()); + if (null != realmNames && !realmNames.isEmpty()) { + return beanEntry -> { + final String source = String.valueOf(beanEntry.getSource()); + return !source.startsWith("ClassRealm") || realmNames.contains(source); + }; + } + return null; + } /** * Walks the {@link ClassRealm} import graph to find all realms visible from the given realm. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sisu-project-releases-1.0.1/org.eclipse.sisu.plexus/src/site/markdown/conversion-to-jsr330.md new/sisu-project-releases-1.1.0/org.eclipse.sisu.plexus/src/site/markdown/conversion-to-jsr330.md --- old/sisu-project-releases-1.0.1/org.eclipse.sisu.plexus/src/site/markdown/conversion-to-jsr330.md 2026-06-24 12:11:18.000000000 +0200 +++ new/sisu-project-releases-1.1.0/org.eclipse.sisu.plexus/src/site/markdown/conversion-to-jsr330.md 2026-07-27 18:47:20.000000000 +0200 @@ -8,18 +8,18 @@ For brevity of examples imports are omitted. The following table defines the meanings and fully-qualified-class-names of the annotations references in the following examples. -| Annotation | Class | Description | -| --- | --- | --- | -| `@Component` | `org.codehaus.plexus.component.annotations.Component` | Legacy Plexus component annotation | -| `@Requirement` | `org.codehaus.plexus.component.annotations.Requirement` | Legacy Plexus injection annotation | -| `@Configuration` | `org.codehaus.plexus.component.annotations.Configuration` | Legacy Plexus configuration annotation | -| `@Named` | `javax.inject.Named` | Standard JSR-330 annotation to provide component name | -| `@Singleton` | `javax.inject.Singleton` | Standard JSR-330 annotation to mark component as singleton | -| `@Typed` | `javax.enterprise.inject.Typed` | JavaEE annotation to mark component type | -| `@Description` | `org.eclipse.sisu.Description` | Sisu-specific annotation to provide a description for a component | -| `@Parameters` | `org.eclipse.sisu.Parameters` | Sisu-specific annotation to mark `Map` injection as container context parameters. | -| `@Inject` | `javax.inject.Inject` | Standard JSR-330 annotation to mark field, parameter, method for injection | -| `@Nullable` | `javax.annotation.Nullable` | Standard JSR-305 annotation to mark field, parameter, result value as potentially returning null value | +| Annotation | Class | Description | +|------------------|----------------------------------------------------------------------|---------------------------------------------------------------------------------------| +| `@Component` | `org.codehaus.plexus.component.annotations.Component` | Legacy Plexus component annotation | +| `@Requirement` | `org.codehaus.plexus.component.annotations.Requirement` | Legacy Plexus injection annotation | +| `@Configuration` | `org.codehaus.plexus.component.annotations.Configuration` | Legacy Plexus configuration annotation | +| `@Named` | `javax.inject.Named` | Standard JSR-330 annotation to provide component name | +| `@Singleton` | `javax.inject.Singleton` | Standard JSR-330 annotation to mark component as singleton | +| `@Typed` | `org.eclipse.sisu.Typed` or `javax.enterprise.inject.Typed` (JavaEE) | Annotation to mark component type | +| `@Description` | `org.eclipse.sisu.Description` | Sisu-specific annotation to provide a description for a component | +| `@Parameters` | `org.eclipse.sisu.Parameters` | Sisu-specific annotation to mark `Map` injection as container context parameters. | +| `@Inject` | `javax.inject.Inject` | Standard JSR-330 annotation to mark field, parameter, method for injection | +| `@Nullable` | `org.eclipse.sisu.Nullable` or `javax.annotation.Nullable` (JSR-305) | Annotation to mark field, parameter, result value as potentially returning null value | **`javax.inject` vs. `com.google.inject`** @@ -320,10 +320,10 @@ public class MyComponent implements Component { - private final List components; + private final List<AnotherComponent> components; @Inject - public MyComponent(final List components) { + public MyComponent(final List<AnotherComponent> components) { this.components = components; } } @@ -400,16 +400,16 @@ This section is specific to how to adapt legacy Plexus component lifecycle interfaces. There is no hard-fast way to adapt these, but there are some guidelines to follow. -| Interface | Class | Description | -| --- | --- | --- | -| Initializable | org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable | Hook was used to inform a component once its injection has been performed. | -| Contextualizable | org.codehaus.plexus.personality.plexus.lifecycle.phase.Contextualizable | Similar to Initializable but passes in the container context. | -| Startable | org.codehaus.plexus.personality.plexus.lifecycle.phase.Startable | Allows components to be started and stopped. | -| Disposable | org.codehaus.plexus.personality.plexus.lifecycle.phase.Disposable | Hook used to inform a component that it is no longer available in the container. | +| Interface | Class | Description | +|------------------|-------------------------------------------------------------------------|----------------------------------------------------------------------------------| +| Initializable | org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable | Hook was used to inform a component once its injection has been performed. | +| Contextualizable | org.codehaus.plexus.personality.plexus.lifecycle.phase.Contextualizable | Similar to Initializable but passes in the container context. | +| Startable | org.codehaus.plexus.personality.plexus.lifecycle.phase.Startable | Allows components to be started and stopped. | +| Disposable | org.codehaus.plexus.personality.plexus.lifecycle.phase.Disposable | Hook used to inform a component that it is no longer available in the container. | ### Initializable -By and far this can be replaced by using constructor-inject, and performing the initialize() at the end of the constructor. +By and far this can be replaced by using constructor-inject, and performing the `initialize()` at the end of the constructor. ``` @Component(role=Component.class, hint="my") @@ -465,6 +465,7 @@ Support for [Sisu/JSR250 lifecycle annotations](../org.eclipse.sisu.inject/lifecycle.html) is available when enabled for the Plexus wrapper ([Maven 3.5+](https://issues.apache.org/jira/browse/MNG-6084) enables JSR250 support). If JSR250 support is not enabled then applications can use other techniques to handle start/stop behavior. The examples below show the solution used in Sonatype Nexus, which relies on a modified implementation of the Google-Guava EventBus to manage lifecycle events. +Sisu provides own annotations as well, in form of `org.eclipse.sisu.PostConstruct` and `org.eclipse.sisu.PreDestroy` with equal semantics. ``` @Component(role=Component.class, hint="my") @@ -557,6 +558,57 @@ } ``` +Alternately, users can define their own lifecycle interface, and use that by injecting those into some component that has access to lifecycle + +``` +public interface MyDisposable { + + void dispose(); + +} +``` + +then make your components implement it + +``` +@Named("my") +@Singleton +public class MyComponent + implements Component, MyDisposable +{ + ... + + @Override + public dispose() { + // do something to "dispose" + } +} +``` + +and finally inject all your disposables into a component that has access to lifecycle (good example is `AbstractMavenLifecycleParticipant` in Maven 3+) + +``` +@Named +@Singleton +public class MyLifecycleParticipant extends AbstractMavenLifecycleParticipant { +{ + private final List<MyDisposable> disposables; + + @Inject + public MyLifecycleParticipant(final List<MyDisposable> disposables) { + this.disposables = disposables; + } + + @Override + public void afterSessionEnd(MavenSession session) { + for (MyDisposable disposable : disposables) { + disposable.dispose(); + } + } +} +``` + + ## Custom Bindings Plugins which require additional custom bindings can provide a @Named Guice module to configure components bindings further. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sisu-project-releases-1.0.1/org.eclipse.sisu.plexus/src/test/java/org/eclipse/sisu/plexus/PlexusLifecycleTest.java new/sisu-project-releases-1.1.0/org.eclipse.sisu.plexus/src/test/java/org/eclipse/sisu/plexus/PlexusLifecycleTest.java --- old/sisu-project-releases-1.0.1/org.eclipse.sisu.plexus/src/test/java/org/eclipse/sisu/plexus/PlexusLifecycleTest.java 2026-06-24 12:11:18.000000000 +0200 +++ new/sisu-project-releases-1.1.0/org.eclipse.sisu.plexus/src/test/java/org/eclipse/sisu/plexus/PlexusLifecycleTest.java 2026-07-27 18:47:20.000000000 +0200 @@ -13,8 +13,6 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import com.google.inject.AbstractModule; -import javax.annotation.PostConstruct; -import javax.annotation.PreDestroy; import org.codehaus.plexus.ContainerConfiguration; import org.codehaus.plexus.DefaultContainerConfiguration; import org.codehaus.plexus.DefaultPlexusContainer; @@ -23,6 +21,25 @@ import org.junit.jupiter.api.Test; class PlexusLifecycleTest { + static class Jsr330Bean { + private final StringBuilder results = new StringBuilder(); + + @org.eclipse.sisu.PostConstruct + public void start() { + results.append("<"); + } + + @org.eclipse.sisu.PreDestroy + public void stop() { + results.append(">"); + } + + @Override + public String toString() { + return results.toString(); + } + } + static class PlexusBean implements Startable { private final StringBuilder results = new StringBuilder(); @@ -45,12 +62,12 @@ static class Jsr250Bean { private final StringBuilder results = new StringBuilder(); - @PostConstruct + @javax.annotation.PostConstruct public void start() { results.append("{"); } - @PreDestroy + @javax.annotation.PreDestroy public void stop() { results.append("}"); } @@ -62,6 +79,23 @@ } @Test + void testJsr330Lifecycle() throws Exception { + // no lifecycle enabled; does not work + PlexusContainer container = createContainer(false); + Jsr330Bean bean = container.lookup(Jsr330Bean.class); + assertEquals("", bean.toString()); + container.dispose(); + assertEquals("", bean.toString()); + + // with jsr250 enabled; works + container = createContainer(true); + bean = container.lookup(Jsr330Bean.class); + assertEquals("<", bean.toString()); + container.dispose(); + assertEquals("<>", bean.toString()); + } + + @Test void testPlexusLifecycle() throws Exception { // standard Plexus lifecycle is always enabled PlexusContainer container = createContainer(false); @@ -100,6 +134,7 @@ return new DefaultPlexusContainer(config.setJSR250Lifecycle(jsr250), new AbstractModule() { @Override protected void configure() { + bind(Jsr330Bean.class); bind(PlexusBean.class); bind(Jsr250Bean.class); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sisu-project-releases-1.0.1/org.eclipse.sisu.plexus.extender/pom.xml new/sisu-project-releases-1.1.0/org.eclipse.sisu.plexus.extender/pom.xml --- old/sisu-project-releases-1.0.1/org.eclipse.sisu.plexus.extender/pom.xml 2026-06-24 12:11:18.000000000 +0200 +++ new/sisu-project-releases-1.1.0/org.eclipse.sisu.plexus.extender/pom.xml 2026-07-27 18:47:20.000000000 +0200 @@ -19,7 +19,7 @@ <parent> <groupId>org.eclipse.sisu</groupId> <artifactId>sisu-inject</artifactId> - <version>1.0.1</version> + <version>1.1.0</version> </parent> <artifactId>org.eclipse.sisu.plexus.extender</artifactId> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sisu-project-releases-1.0.1/pom.xml new/sisu-project-releases-1.1.0/pom.xml --- old/sisu-project-releases-1.0.1/pom.xml 2026-06-24 12:11:18.000000000 +0200 +++ new/sisu-project-releases-1.1.0/pom.xml 2026-07-27 18:47:20.000000000 +0200 @@ -18,7 +18,7 @@ <groupId>org.eclipse.sisu</groupId> <artifactId>sisu-inject</artifactId> - <version>1.0.1</version> + <version>1.1.0</version> <packaging>pom</packaging> <name>${project.groupId}:${project.artifactId}</name> @@ -81,7 +81,7 @@ <scm> <connection>scm:git:git://github.com/eclipse-sisu/sisu-project.git</connection> <developerConnection>scm:git:[email protected]:eclipse-sisu/sisu-project.git</developerConnection> - <tag>releases/1.0.1</tag> + <tag>releases/1.1.0</tag> <url>https://github.com/eclipse-sisu/sisu-project/tree/main</url> </scm> <issueManagement> @@ -116,7 +116,7 @@ <maven.compiler.source>${maven.compiler.release}</maven.compiler.source> <maven.compiler.target>${maven.compiler.release}</maven.compiler.target> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> - <project.build.outputTimestamp>2026-06-24T10:10:57Z</project.build.outputTimestamp> + <project.build.outputTimestamp>2026-07-27T16:47:03Z</project.build.outputTimestamp> <!-- Source headers --> <sisu.licenseHeader>https://raw.githubusercontent.com/eclipse-sisu/sisu-project/main/license-header-epl2.txt</sisu.licenseHeader> @@ -132,9 +132,9 @@ <guiceVersion>4.2.3</guiceVersion> <!-- define empty, as jacoco is only conditionally executed (https://www.eclemma.org/jacoco/trunk/doc/prepare-agent-mojo.html) --> <argLine /> - <njordVersion>0.9.8</njordVersion> + <njordVersion>0.9.9</njordVersion> <!-- Spotless versions --> - <spotlessMavenPluginVersion>3.7.0</spotlessMavenPluginVersion> + <spotlessMavenPluginVersion>3.8.0</spotlessMavenPluginVersion> <spotlessPalantirJavaFormatVersion>2.86.0</spotlessPalantirJavaFormatVersion> </properties> @@ -417,7 +417,7 @@ <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jar-plugin</artifactId> - <version>3.5.0</version> + <version>3.5.1</version> <executions> <execution> <id>default-jar</id> @@ -567,7 +567,7 @@ <plugin> <groupId>org.eclipse.sisu</groupId> <artifactId>sisu-maven-plugin</artifactId> - <version>1.0.0</version> + <version>1.0.1</version> <executions> <execution> <id>index-project</id> @@ -614,7 +614,7 @@ <plugin> <groupId>com.mycila</groupId> <artifactId>license-maven-plugin</artifactId> - <version>5.0.0</version> + <version>5.1.1</version> <configuration> <aggregate>true</aggregate> <strictCheck>true</strictCheck>
