Gradle and Maven Configuration
Configure Mavenβ
- Configure local repository path
<localRepository>d:/mvnrepository</localRepository>
- Configure remote repository address
<mirror>
<id>nexus-aliyun</id>
<mirrorOf>central</mirrorOf>
<name>Nexus aliyun</name>
<url>https://maven.aliyun.com/repository/public</url>
</mirror>
- Configure JDK to 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>
Configure Gradleβ
- In the
init.dfile underGRADLE_HOME, create ainit.gradleconfiguration file:
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 Enable Daemon Original Article Create a
C:\Users\user\.gradle\gradle.propertiesfile in user directory, file content:org.gradle.daemon=true
(if not exist "%USERPROFILE%/.gradle" mkdir "%USERPROFILE%/.gradle") && (echo org.gradle.daemon=true >> "%USERPROFILE%/.gradle/gradle.properties")
- IDEA configure Gradle local repository address

Handle Gradle Issues when Importing Source Codeβ
When I imported branch 2.5.x version code, using Gradle 5.6.4 caused issues. The reason is that old version of gradle lacks some features, e.g., OperationCompletionListener, error as follows:

Use wrapper gradle. That is execute ./gradlew in project root path, but it still reports failed: timeout

Then you need to change command to specify longer timeout, command as follows:
./gradlew -Dorg.gradle.internal.http.socketTimeout=60000 -Dorg.gradle.internal.http.connectionTimeout=60000 --daemon Command from
Of course you can configure via IDE, this will also automatically use wrapper for build

- Attribution: Retain the original author's signature and code source information in the original and derivative code.
- Preserve License: Retain the Apache 2.0 license file in the original and derivative code.
- Attribution: Give appropriate credit, provide a link to the license, and indicate if changes were made.
- NonCommercial: You may not use the material for commercial purposes. For commercial use, please contact the author.
- ShareAlike: If you remix, transform, or build upon the material, you must distribute your contributions under the same license as the original.