Summary of Gradle usage in the project

Source: Internet
Author: User

I. Configuring Gradle using the Maven warehouse

During the project, we may encounter Maven's local libraries and Gradle used by the MAVEN local library, not the same library. Now summarize how the configuration makes both Maven and Gradle use the same Maven local libraries:

First of all, we need to understand two concepts: Maven local library [presentation is generally. m2], gradle local library [expression is generally. Gradle]

1.maven Configuring the Local library:

Mainly in the Settings.xml file, add the following content:

<localRepository>/xxxxx/repository</localRepository>

2. Gradle configuration using the MAVEN local library:

Modify the Build.gradle file to add the following:

repositories {                  mavenLocal()          }

Note: This development is added in Build.gradle, and the MAVEN local library has been used by default.

3. Let Gradle you can read to MAVEN's local library configuration

The gradle uses the same policy as Maven to locate the local MAVEN cache location. If the address of the local MAVEN warehouse is defined in settings.xml, the address is used. The configuration in the Settings.xml file under user_home/.m2 overwrites the configuration in the settings.xml file that is stored under m2_home/conf. If there is no settings.xml configuration file, Gradle will use the default User_home/.m2/repository address.

4. Modify the Gradle local library [this is not related to the MAVEN local library, just this. Gradle folder is in too big, often need to move the external disk.]

Design Environment variables: gradle_user_home=/xxx/.gradle

Two. jdk1.8 Execute gradle command Prompt "Invalid source release: 1.8"



WORKAROUND: Project Right-"Run as-" Gradle build--arguments– "java home–" workspace JRE selection jdk1.8

Reprint Please specify: http://www.xujin.org

Summary of Gradle usage in the project

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.