XiaodaBlogSource/source/_posts/Maven与Gradle.md
2025-03-19 21:19:20 +08:00

35 lines
654 B
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
title: Maven与Gradle
date: 2023-11-18 10:30:31
author: 文永达
---
# Maven
## Maven to Gradle
`pom.xml`文件所在的目录下执行:
```shell
gradle init # 根据pom.xml内容生成对应的gradle配置
gradle build # 开启gradle构建
```
# Gradle
## Gradle to Maven
`Gradle`项目转`Maven`项目需要借助一个Gradle插件在项目的`module``build.gradle`文件中加入以下配置即可
```shell
apply plugin: 'maven'
```
执行命令
``` shell
gradle install
```
完成之后将会在当前Module项目的build目录下的poms文件夹下生成pom-default.xml将其拷贝到项目的根目录下即可。