Migrate 10 @Component classes to JSR330 annotations in p2-maven-plugin#5514
Merged
Conversation
Migrated classes: - DefaultProvisioningAgentProvider - MetadataIO - InstallableUnitSlicer - ProxyHelper (Initializable -> @PostConstruct) - SettingsDecrypterHelper - DefaultTransportCacheConfig (Initializable -> @PostConstruct) - SharedHttpCacheStorage - MavenAuthenticator (Initializable -> @PostConstruct) - InstallableUnitGenerator - InstallableUnitPublisher Changes: - Replaced @component with @nAmed + @singleton - Replaced @requirement with @Inject - Replaced @requirement(hint=...) with @Inject + @nAmed("...") - Replaced Initializable.initialize() with @PostConstruct - Added javax.annotation-api dependency for @PostConstruct Reference: #1494 Co-authored-by: laeubi <1331477+laeubi@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Migrate @Component annotated classes to JSR330 annotations
Migrate 10 @Component classes to JSR330 annotations in p2-maven-plugin
Oct 24, 2025
Test Results1 017 files ±0 1 017 suites ±0 6h 40m 14s ⏱️ + 38m 43s For more details on these errors, see this check. Results for commit 8f4f799. ± Comparison against base commit b3d0b08. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR migrates 10
@Componentannotated classes in the p2-maven-plugin module from deprecated Plexus annotations to JSR330 annotations, continuing the effort tracked in #1494.Migrated Classes
The following classes have been migrated:
DefaultProvisioningAgentProvider- ImplementsIProvisioningAgentProviderMetadataIO- P2 metadata I/O utilitiesInstallableUnitSlicer- Computes dependency slicesInstallableUnitPublisher- Publishes metadata using publisher actionsSettingsDecrypterHelper- Decrypts Maven settingsDefaultTransportCacheConfig- Transport cache configurationSharedHttpCacheStorage- HTTP cache storage implementationProxyHelper- Maven proxy configuration helperMavenAuthenticator- HTTP/Proxy authentication handlerInstallableUnitGenerator- Generates installable units from artifactsMigration Pattern
Following the Plexus to JSR330 migration guide:
@Component(role = X.class)@Named+@Singleton@Requirement@Inject@Requirement(hint = "...")@Inject+@Named("...")Initializable.initialize()@PostConstructChanges
Initializablelifecycle methods to@PostConstructin 3 classes (ProxyHelper, DefaultTransportCacheConfig, MavenAuthenticator)throws InitializationExceptiondeclarations (not needed with@PostConstruct)javax.annotation-apidependency to pom.xml for@PostConstructannotation supportVerification
mvn clean install -T1C -DskipTestssisu-maven-plugincorrectly generatesMETA-INF/sisu/javax.inject.Namedwith all migrated classesNotes
The
@Injectannotation forMap<String, InstallableUnitProvider>inInstallableUnitGeneratorfollows the same pattern used throughout the codebase (e.g., inTychoProjectManager,ZipComparatorImpl,BndPluginManager). Sisu automatically collects all components of the specified type into the injected Map.Related to #1494
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
testng.org/opt/hostedtoolcache/CodeQL/2.23.1/x64/codeql/tools/linux64/java/bin/java -jar /opt/hostedtoolcache/CodeQL/2.23.1/x64/codeql/xml/tools/xml-extractor.jar --fileList=/home/REDACTED/work/tycho/.codeql-scratch/dbs/java/working/files-to-index224183699525497144.list --sourceArchiveDir=/home/REDACTED/work/tycho/.codeql-scratch/dbs/java/src --outputDir=/home/REDACTED/work/tycho/.codeql-scratch/dbs/java/trap/java(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.