{"id":20608928,"url":"https://github.com/mybatis/cdi","last_synced_at":"2025-04-09T10:06:08.099Z","repository":{"id":12362606,"uuid":"15011588","full_name":"mybatis/cdi","owner":"mybatis","description":"MyBatis CDI Extension","archived":false,"fork":false,"pushed_at":"2025-04-01T02:07:23.000Z","size":5402,"stargazers_count":25,"open_issues_count":4,"forks_count":20,"subscribers_count":15,"default_branch":"master","last_synced_at":"2025-04-01T03:23:14.486Z","etag":null,"topics":["cdi","extension","jakarta-ee","java","java-ee"],"latest_commit_sha":null,"homepage":null,"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/mybatis.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2013-12-07T19:33:41.000Z","updated_at":"2025-04-01T02:07:04.000Z","dependencies_parsed_at":"2023-12-29T02:41:33.501Z","dependency_job_id":"81332df0-8bab-4548-977a-1252407886e2","html_url":"https://github.com/mybatis/cdi","commit_stats":{"total_commits":821,"total_committers":15,"mean_commits":"54.733333333333334","dds":0.5164433617539586,"last_synced_commit":"09da72cceaba4677ac8759348f063b597a1dbf92"},"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mybatis%2Fcdi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mybatis%2Fcdi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mybatis%2Fcdi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mybatis%2Fcdi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mybatis","download_url":"https://codeload.github.com/mybatis/cdi/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248018060,"owners_count":21034048,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["cdi","extension","jakarta-ee","java","java-ee"],"created_at":"2024-11-16T10:12:15.885Z","updated_at":"2025-04-09T10:06:08.073Z","avatar_url":"https://github.com/mybatis.png","language":"Java","readme":"MyBatis CDI Extension\n=====================\n\n[![Java CI](https://github.com/mybatis/cdi/workflows/Java%20CI/badge.svg)](https://github.com/mybatis/cdi/actions?query=workflow%3A%22Java+CI%22)\n[![Coverage Status](https://coveralls.io/repos/mybatis/cdi/badge.svg?branch=master\u0026service=github)](https://coveralls.io/github/mybatis/cdi?branch=master)\n[![Maven central](https://maven-badges.herokuapp.com/maven-central/org.mybatis/mybatis-cdi/badge.svg)](https://maven-badges.herokuapp.com/maven-central/org.mybatis/mybatis-cdi)\n[![Sonatype Nexus (Snapshots)](https://img.shields.io/nexus/s/https/oss.sonatype.org/org.mybatis/mybatis-cdi.svg)](https://oss.sonatype.org/content/repositories/snapshots/org/mybatis/mybatis-cdi/)\n[![License](https://img.shields.io/:license-apache-brightgreen.svg)](https://www.apache.org/licenses/LICENSE-2.0.html)\n\n![mybatis-logo](https://mybatis.org/images/mybatis-logo.png)\n\nMyBatis-CDI extension takes care of the lifecycle of MyBatis mappers and SqlSessions. MyBatis components are directly injected into your\nCDI beans ready to be used, there is no need to create or destroy them. It also provides local and JTA transaction support based on the\n@Transactional annotation.\n\nCompatibility\n-------------\n\n| CDI API VERSION         | JDK 17 | JDK 11  | JDK 8  |\n| ----------------------- | ------ | ------- | ------ |\n| cdi-1.0 (not supported) | N      | N       | N      |\n| cdi-1.1                 | Y      | Y       | Y      |\n| cdi-1.2                 | Y      | Y       | Y      |\n| cdi-2.0                 | Y      | Y       | Y      |\n| cdi-3.0                 | Y      | Y       | N      |\n| cdi-4.0                 | Y      | Y       | N      |\n| cdi-4.1                 | Y      | N       | N      |\n\nJavaEE is 1.1.4 and is now no longer our focus\n\nJakartaEE is 2.0.0 and is the main focus\n\nJdk17+ requires jboss-classfilewriter to be at 1.2.5 or it will error, [classfilewriter](https://github.com/jbossas/jboss-classfilewriter/issues/24)\n\nBuilding from [tag](https://github.com/mybatis/cdi/tree/mybatis-cdi-1.1.4) for javax namespace\n----------------------------------------------------------------------------------------------\n\nMaven does not allow multiple auto activated profiles (ie activateByDefault and Jdk).  This project supports 3 different CDI support levels currently\nand was set to default to cdi-1.2.  Jdk 8 does not allow add opens and this is needed now for jdk 17.  We further are supporting jakarta EE packaging\nin addition to java EE packaging.  This results is a tricky situation.  Therefore, we have opted to no longer use activateByDefault which means a\nbuild without providing a profile will fail with missing classes.  Github actions is provisioned to always provide the specific cdi-api profile.\nAny localized usage must now do the same as defined below.\n\nThe cdi profile can be cdi-1.1, cdi-1.2, or cdi-2.0 and required to run with any of the following.\n\n- mvn clean install -P\"cdi-1.1\"\n- mvn clean install -P\"cdi-1.2\"\n- mvn clean install -P\"cdi-2.0\"\n\nBuilding from master\n--------------------\n\nNormal maven build without any special profiles necessary.  This line is Jakarta.\n\nTesting with Arquillian (for javaEE, has not been checked with jakarta)\n-----------------------------------------------------------------------\n\nIn order to test with Arquillian, one class needs to be added to 'JavaArchive' in order for this to load properly.  Add 'SqlSessionManagerRegistry.class'.\n\nSee attachment on https://github.com/mybatis/cdi/issues/86 from 2021-12-30 ArquillianMybatisExample.zip [here](https://github.com/mybatis/cdi/files/7795050/ArquillianMybatisExample.zip).  This is to be run under jdk 8 to be error free but will run as-is under jdk 11 with an invocation error which still allows it to run.  Further updates are needed to get this code example current.\n\nEssentials\n----------\n\n- [See the docs](https://mybatis.org/cdi/)\n\u003c!-- - [See the docs(简体中文)](https://mybatis.org/cdi/zh/index.html) --\u003e\n\nContributed Examples\n--------------------\n\n- Ready to deploy sample web app (Jee7): [samples](https://github.com/mnesarco/mybatis-cdi-samples/)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmybatis%2Fcdi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmybatis%2Fcdi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmybatis%2Fcdi/lists"}