{"id":23095042,"url":"https://github.com/microbean/microbean-maven-cdi","last_synced_at":"2026-05-19T19:32:05.637Z","repository":{"id":57739583,"uuid":"85617855","full_name":"microbean/microbean-maven-cdi","owner":"microbean","description":"A CDI extension that embeds the Maven Artifact Resolver machinery inside CDI environments.","archived":false,"fork":false,"pushed_at":"2019-12-04T04:19:55.000Z","size":1178,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-06T20:07:22.593Z","etag":null,"topics":["aether","cdi","cdi-extension","java","java-library","maven"],"latest_commit_sha":null,"homepage":"https://microbean.github.io/microbean-maven-cdi/","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/microbean.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-03-20T19:31:44.000Z","updated_at":"2021-05-07T19:25:25.000Z","dependencies_parsed_at":"2022-08-24T17:50:37.498Z","dependency_job_id":null,"html_url":"https://github.com/microbean/microbean-maven-cdi","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/microbean/microbean-maven-cdi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microbean%2Fmicrobean-maven-cdi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microbean%2Fmicrobean-maven-cdi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microbean%2Fmicrobean-maven-cdi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microbean%2Fmicrobean-maven-cdi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/microbean","download_url":"https://codeload.github.com/microbean/microbean-maven-cdi/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microbean%2Fmicrobean-maven-cdi/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33229365,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-19T15:49:41.270Z","status":"ssl_error","status_checked_at":"2026-05-19T15:49:22.917Z","response_time":58,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aether","cdi","cdi-extension","java","java-library","maven"],"created_at":"2024-12-16T22:19:19.873Z","updated_at":"2026-05-19T19:32:00.624Z","avatar_url":"https://github.com/microbean.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# microBean™ Maven CDI\n\n[![Build Status](https://travis-ci.org/microbean/microbean-maven-cdi.svg?branch=master)](https://travis-ci.org/microbean/microbean-maven-cdi)\n[![Maven Central](https://maven-badges.herokuapp.com/maven-central/org.microbean/microbean-maven-cdi/badge.svg)](https://maven-badges.herokuapp.com/maven-central/org.microbean/microbean-maven-cdi)\n\nThe microBean™ Maven CDI project embeds the [Maven machinery responsible\nfor interacting with artifact repositories][maven-resolver] into your CDI 2.0\nenvironment.\n\n## Background and History\n\nThe internal Maven machinery for interacting with artifact\nrepositories has gone through several phases of existence.\n\nIts earliest incarnation is in the form of the\n[`maven-artifact-resolver`](http://search.maven.org/classic/#artifactdetails%7Corg.apache.maven.shared%7Cmaven-artifact-resolver%7C1.0%7Cjar)\nartifact, version 1.0, _circa_ 2009 (here in 2019 this artifact should\nnot be used).\n\nThis code was subsequently [broken out as a standalone project][sonatype-aether]\ninto [Sonatype](https://www.sonatype.com/)'s [\u0026AElig;ther\nproject](https://github.com/sonatype/sonatype-aether) in [August\n2010][sonatype-aether].\n\nSonatype \u0026AElig;ther then moved to the Eclipse foundation in [August\n2014][eclipse-aether], but never really caught on as a standalone project outside\nof its original Maven-oriented user base, and was [archived in January\n2015][eclipse-aether].\n\nThe Sonatype \u0026AElig;ther project was handed _back_ to the Maven\nproject and reincarnated as the [Maven Artifact Resolver\nproject][maven-resolver] in January 2017, with an overarching artifact\nidentifier of [`maven-resolver`][maven-resolver] (not `maven-artifact-resolver`).\nSomewhat oddly, the package names have not changed, so the classes\nprovided by the `maven-resolver` project all start with the\n`org.eclipse.aether.` prefix.\n\nThis project adapts the [`maven-resolver`][maven-resolver] project to CDI\nenvironments.\n\n## Installation\n\nPlace this project's `.jar` file on your classpath.\n\n## How It Works\n\nThe [`maven-resolver` project][maven-resolver] fortunately was written\nwith dependency injection in mind.  Specifically, it was written as a\n[Guice module](https://github.com/google/guice/wiki/GettingStarted) to\nbe used from within Maven proper, which, at least in recent versions,\nuses [Guice](https://github.com/google/guice/) under the covers.\n\nThe microBean™ Maven CDI project does just enough work to re-express\ncertain Maven Guice components using CDI constructs so that you may\nsimply inject the parts of `maven-resolver` that you need.\n\nFor example, to work with artifact repositories, you're going to need\na\n[`RepositorySystem`](https://maven.apache.org/components/resolver/maven-resolver-api/apidocs/org/eclipse/aether/RepositorySystem.html)\nand a\n[`RepositorySystemSession`](https://maven.apache.org/components/resolver/maven-resolver-api/apidocs/org/eclipse/aether/RepositorySystemSession.html).\nWith microBean™ Maven CDI, you simply do this:\n\n    @Inject\n    private RepositorySystem repositorySystem;\n\n    @Inject\n    private RepositorySystemSession repositorySystemSession;\n\n\u0026hellip;and the [`MavenExtension` portable\nextension](apidocs/org/microbean/maven/cdi/MavenExtension.html) takes\ncare of setting up the dozens of supporting objects for you behind the\nscenes.\n\nmicroBean™ Maven CDI also natively understands your user-level\n[`~/.m2/settings.xml` file](https://maven.apache.org/settings.html),\nand can use it so that you can inject the right remote repositories,\neven taking its [local\nrepository](https://maven.apache.org/settings.html#Simple_Values) and\n[mirrors](https://maven.apache.org/guides/mini/guide-mirror-settings.html)\nsettings into consideration:\n\n    @Inject\n    @Resolution // for dependency resolution, as opposed to, say, deployment\n    private List\u003cRemoteRepository\u003e remoteRepositories;\n\n## Usage\n\nHere is some pseudocode showing how you might go about resolving the\n(arbitrarily chosen for this example) [`org.slf4j:slf4j-api:1.7.24`\nartifact](http://search.maven.org/#artifactdetails%7Corg.slf4j%7Cslf4j-api%7C1.7.24%7Cjar)\nfrom within your CDI bean:\n\n    import org.eclipse.aether.RepositorySystemSession;\n    import org.eclipse.aether.RepositorySystem;\n\n    import org.eclipse.aether.artifact.Artifact;\n    import org.eclipse.aether.artifact.DefaultArtifact;\n\n    import org.eclipse.aether.collection.CollectRequest;\n\n    import org.eclipse.aether.repository.RemoteRepository;\n\n    import org.eclipse.aether.resolution.ArtifactResult;\n    import org.eclipse.aether.resolution.DependencyRequest;\n    import org.eclipse.aether.resolution.DependencyResolutionException;\n    import org.eclipse.aether.resolution.DependencyResult;\n\n    import org.eclipse.aether.util.artifact.JavaScopes;\n\n    import org.eclipse.aether.util.filter.DependencyFilterUtils;\n\n    @Inject\n    private RepositorySystem repositorySystem;\n\n    @Inject\n    private RepositorySystemSession session;\n\n    @Inject\n    @Resolution\n    private List\u003cRemoteRepository\u003e remoteRepositories;\n\n    public void resolve() throws DependencyResolutionException {\n      final CollectRequest collectRequest = new CollectRequest();\n      final Artifact artifact = new DefaultArtifact(\"org.slf4j\", \"slf4j-api\", \"jar\", \"1.7.24\");\n      collectRequest.setRoot(new Dependency(artifact, JavaScopes.COMPILE));\n      collectRequest.setRepositories(remoteRepositories);\n\n      final DependencyRequest dependencyRequest = new DependencyRequest(collectRequest, DependencyFilterUtils.classpathFilter(JavaScopes.COMPILE));\n      final DependencyResult dependencyResult = repositorySystem.resolveDependencies(session, dependencyRequest);\n      final List\u003cArtifactResult\u003e artifactResults = dependencyResult.getArtifactResults();\n    }\n\n[maven-resolver]: http://maven.apache.org/resolver\n[sonatype-aether]: http://blog.sonatype.com/2010/08/introducing-aether/\n[eclipse-aether]: https://projects.eclipse.org/projects/technology.aether\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicrobean%2Fmicrobean-maven-cdi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmicrobean%2Fmicrobean-maven-cdi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicrobean%2Fmicrobean-maven-cdi/lists"}