- 下载Gradle
- 环境变量配置
GRADLE_HOME
指向安装目录 - 环境变量配置
GRADLE_USER_HOME
指向依赖下载目录 - 往
Path
中添加%GRADLE_HOME%bin
- 在
USER_HOME
路径, 路径示例:C:Usersroot.m2
. 添加settings.xml
文件配置maven本地仓库地址, 如下.
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<localRepository>E:softmavenrepository</localRepository>
<mirrors>
<mirror>
<id>nexus-aliyun</id>
<mirrorOf>central</mirrorOf>
<name>Nexus aliyun</name>
<url>http://maven.aliyun.com/nexus/content/groups/public</url>
</mirror>
<mirror>
<id>maven</id>
<mirrorOf>central</mirrorOf>
<name>maven</name>
<url>http://repo1.maven.org/maven2/</url>
</mirror>
</mirrors>
</settings>
6. 项目中配置
代码语言:javascript复制repositories {
mavenLocal()
maven { url "https://maven.aliyun.com/repository/public" }
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
mavenCentral()
}
7. 再使用maven-publish
插件, 就可以直接将项目发布到本地仓库