# Maven 依赖
> 以下的 xml maven 依赖示例中,可能并非最新的 MyBatis-Flex 版本,请自行查看最新版本,并修改版本号。
>
> 建议配置 annotationProcessorPaths,那么可以省略mybatis-flex-processor的依赖
>
1、只用到了 MyBatis,没用到 Spring 的场景:
```xml
com.mybatis-flex
mybatis-flex-core
1.10.2
com.mybatis-flex
mybatis-flex-processor
1.10.2
provided
```
2、用到了 Spring 的场景
```xml
com.mybatis-flex
mybatis-flex-spring
1.10.2
com.mybatis-flex
mybatis-flex-processor
1.10.2
provided
``````
3、用到了 SpringBoot v2.x 的场景
```xml 3
com.mybatis-flex
mybatis-flex-spring-boot-starter
1.10.2
com.mybatis-flex
mybatis-flex-processor
1.10.2
provided
```
4、用到了 SpringBoot v3.x 的场景
```xml 3
com.mybatis-flex
mybatis-flex-spring-boot3-starter
1.10.2
com.mybatis-flex
mybatis-flex-processor
1.10.2
provided
```
5、配置 annotationProcessor
`mybatis-flex-processor`提供APT服务,可以配置到annotationProcessorPaths,配置后,无需在依赖中声明`mybatis-flex-processor`依赖。
参考:[APT 设置-和 Lombok、Mapstruct 整合](../others/apt.md)
> 在Kotlin中使用时,请参考[在Kotlin中使用注解处理器](../others/kapt.md)
```xml
org.apache.maven.plugins
maven-compiler-plugin
3.8.1
com.mybatis-flex
mybatis-flex-processor
1.10.2
```
6、配置依赖管理
MyBatis-Flex 提供了 `mybatis-flex-dependencies` 模块进行依赖管理,只需要在 `` 标签下进行配置就可以了。
```xml
com.mybatis-flex
mybatis-flex-dependencies
${mybatis-flex.version}
pom
import
```
在使用时就可以不指定 `` 标签了,例如:
```xml
com.mybatis-flex
mybatis-flex-spring-boot-starter
com.mybatis-flex
mybatis-flex-codegen
```