Use of Gradle in eclipse

Source: Internet
Author: User

Installing Gradle

Gradle The default local cache library is located under the. Gradle folder in the C-disk USER directory, you can add environment variables Gradle_user_home Custom cache locations after you install Gradle.

Installing the Eclipse Plugin

Eclipse App Market, search buildship, a plugin for the Eclipse official community, currently in version 1.0.

New Gradle Project

↓new Gradle Project, options, you can point to the local Gradle installation directory.

↓ Convert project to Web project type, project properties, project Facets

Gradle Configuration

↓ Open Build.gradle, such as the library that introduced SSH. Gradle defaults to the Jcenter warehouse, where maven repositories are used.

1Apply plugin:'Java'2 3 Repositories {4 mavencentral ()5 }6 7 Dependencies {8     //Struts Library9Compile group:'org.apache.struts', Name:'Struts2-core', Version:'2.3.24.1'TenCompile'org.apache.struts:struts2-spring-plugin:2.3.24.1' OneCompile'org.apache.struts:struts2-json-plugin:2.3.24.1' A      -     //Spring Library -Compile group:'org.springframework', Name:'Spring-core', Version:'4.2.3.RELEASE' theCompile group:'org.springframework', Name:'Spring-web', Version:'4.2.3.RELEASE' -Compile group:'org.springframework', Name:'Spring-orm', Version:'4.2.3.RELEASE' -Compile group:'org.springframework', Name:'SPRING-AOP', Version:'4.2.3.RELEASE' -Compile group:'org.springframework', Name:'spring-aspects', Version:'4.2.3.RELEASE' +Compile group:'org.springframework', Name:'Spring-jdbc', Version:'4.2.3.RELEASE' -      +     //Hibernate Library ACompile group:'org.hibernate', Name:'Hibernate-core', Version:'5.0.1.Final' at      -     //Common Library -Compile'org.slf4j:slf4j-api:1.7.13' -Compile'mysql:mysql-connector-java:5.1.38' -Compile'org.apache.commons:commons-pool2:2.4.2' -Compile'org.apache.commons:commons-dbcp2:2.1.1' in      -Testcompile'junit:junit:4.12' to}

↓ configuration complete, refresh project, automatically download dependent libraries. Looking at the structure of project, all the dependencies are introduced.

Use of Gradle in eclipse

Related Article

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.