Conversation
Add a new URL handler service under services/url that provides a native replacement for pax-url-mvn. The service registers a URLStreamHandlerService for the mvn: protocol and exposes a MavenResolver API for programmatic artifact resolution from local and remote Maven repositories.
Remove the redundant explicit Bundle-Activator instruction, which collided with the activator class already detected by karaf-services-maven-plugin and produced an invalid duplicate-type manifest header, failing the bundle build. Also embed org.apache.karaf.util.maven and org.apache.karaf.util.tracker(.annotation), which are provided-scope dependencies that were not packaged into the bundle, leaving Parser and BaseActivator unresolved at runtime.
Test Results 744 files + 39 744 suites +39 1h 17m 24s ⏱️ - 5m 36s Results for commit 9e419dc. ± Comparison against base commit 681f0cc. This pull request removes 10 and adds 205 tests. Note that renamed tests count towards both.This pull request removes 10 skipped tests and adds 96 skipped tests. Note that renamed tests count towards both.♻️ This comment has been updated with latest results. |
Add a wrap: URL handler to the native Karaf URL service, equivalent to pax-url-wrap. The handler supports the same syntax (wrap:jar-url[,instructions-url][$instructions]), the overwrite modes (keep, merge, full) and the same defaults (optional Import-Package, Export-Package: *, symbolic name derived from the URL). The OSGi manifest is generated with bnd, embedded privately in the bundle (only the used packages, with the OSGi API not provided by the framework), so all bnd instructions are supported.
…bution The karaf-light distribution now provides the mvn: and wrap: protocols with the native Karaf URL service instead of pax-url-aether and pax-url-wrap. - features.core resolves the Maven artifacts through a resolver abstraction, using the Karaf URL service MavenResolver when available and pax-url-aether otherwise. The org.ops4j.pax.url.mvn import is now optional. - feature:export-bundles relies on the URL handlers instead of the pax-url-aether MavenResolver service. - Add the url feature (Karaf URL service at start level 5 and its etc/org.apache.karaf.url.mvn.cfg configuration) to the standard features. - karaf-light uses url as startup feature and blacklists the pax-url-aether and pax-url-wrap bundles (the wrap feature stays as marker for the wrap deployer and the wrap prerequisites). The unused pax-url files are removed from the assembly. - The Karaf URL service declares its URL handler capabilities, supports the @multi repositories (KAR repositories), and waits for the ConfigAdmin configuration when org.apache.karaf.url.mvn.requireConfigAdminConfig is set (as in etc/config.properties). - Child instances get the Karaf URL service configuration and the features processing file of the root instance.
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.
Part of #2212, closes #2332.
Add a native Karaf URL service as an alternative to Pax URL, and use it in the
apache-karaf-lightdistribution.Karaf URL service (
services/url)mvn:protocol handler andMavenResolverservice, resolving artifacts from the default (local, file-based) repositories, the local repository and remote repositories, without Aether. Configuration PID:org.apache.karaf.url.mvn(property names compatible withorg.ops4j.pax.url.mvn).wrap:protocol handler, equivalent to pax-url-wrap: same syntax (wrap:jar-url[,instructions-url][$instructions]), overwrite modes (keep,merge,full) and defaults. The manifest is generated with bnd (7.4.0), embedded privately in the bundle (only the used packages), so all bnd instructions are supported. The bundle is about 2.5 MB because of bnd.@multirepositories (KAR repositories), declares the URL handler capabilities, and waits for the ConfigAdmin configuration whenorg.apache.karaf.url.mvn.requireConfigAdminConfigis set.karaf-light distribution
urlfeature in the standard features (Karaf URL service at start level 5 with itsetc/org.apache.karaf.url.mvn.cfg), used as startup feature by karaf-light.wrapfeature stays as marker for the wrap deployer and thewrapprerequisites), and the unused pax-url files are removed from the assembly.features.coreresolves the artifacts through a resolver abstraction: the Karaf URL serviceMavenResolverwhen available, pax-url-aether otherwise. Theorg.ops4j.pax.url.mvnimport is now optional, so the default distribution is unchanged.feature:export-bundlesrelies on the URL handlers instead of the pax-url-aetherMavenResolverservice.Testing
wrap:mvn:installs, deploy folder wrapping,feature:installwithwrap:bundles,feature:export-bundles,kar:install, child instance create/start.feature:export-bundlesandwrap:installs work.Known limitations
maven-metadata.xml: remote snapshots,LATESTand version ranges are not resolved.maven:*commands still target theorg.ops4j.pax.url.mvnconfiguration.