如何配置Maven、Gradle
配置maven
- 配置本地仓库路径
<localRepository>d:/mvnrepository</localRepository>
- 配置远程库地址
<mirror>
<id>nexus-aliyun</id>
<mirrorOf>central</mirrorOf>
<name>Nexus aliyun</name>
<url>https://maven.aliyun.com/repository/public</url>
</mirror>
- 配置JDK为1.8
<profile>
<id>jdk-1.8</id>
<activation>
<activeByDefault>true</activeByDefault>
<jdk>1.8</jdk>
</activation>
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.compilerVersion>1.8</maven.compiler.compilerVersion>
</properties>
</profile>
配置gradle-7.3
- 在
GRADLE_HOME
下的init.d文件中,创建一个init.gradle
配置文件:
allprojects {
repositories {
maven { url 'file:///D:/mvnrepository'}
mavenLocal()
maven { name "Alibaba" ; url "https://maven.aliyun.com/repository/public" }
maven { name "Bstek" ; url "http://nexus.bsdn.org/content/groups/public/" }
mavenCentral()
}
buildscript {
repositories {
maven { name "Alibaba" ; url 'https://maven.aliyun.com/repository/public' }
maven { name "Bstek" ; url 'http://nexus.bsdn.org/content/groups/public/' }
maven { name "M2" ; url 'https://plugins.gradle.org/m2/' }
}
}
}
-
Gradle开启Daemon原文地址在用户目录下创建一个
C:\Users\user\.gradle\gradle.properties
文件,文件内容rg.gradle.daemon=true
(if not exist "%USERPROFILE%/.gradle" mkdir "%USERPROFILE%/.gradle") && (echo org.gradle.daemon=true >> "%USERPROFILE%/.gradle/gradle.properties")
- idea配置gradle本地仓库地址
转载请注明 原文地址