Use the Spring boot project in Eclipse to build dependency management using Gradle

Source: Internet
Author: User
Tags jcenter

mentioned above:

Gradle existed for a long time, only to know that Maven and Ivy, only recently knew this existence, because later will use this; So, to learn how to use this tool, start by building a simple project!

In fact, I have seen Gradle before, but did not pay attention to, of course, there are many, look at the picture:

  

There are so many dependent management tools!

Using tools:

Ide:eclipse

jdk:1.7

gradle:3.0

Springboot

Specific steps:

1. Eclipse Add Gradle Support:

Install Eclipse bulidship plugin: eclipse-->help-->eclipse marketpalce---> Search gradle

    

2, the official website download Gradle-3.0-bin.zip Reserve;

3, Eclipse New Project Select Gradle, you can choose the default options, you can also configure your own gradlehome

    

4, modify the Build.gradle configuration file, add dependencies

Apply plugin: ' java 'Apply Plugin: ' Maven 'Apply Plugin: ' Maven-publish 'sourcecompatibility= 1.7Compilejava. options.encoding = ' UTF-8 'version= ' 1.0 'repositories {jcenter () Maven {name' Maven Repository 'URL"${repositorymavenurl}"} ivy {name' Ivy Repository 'URL"${repositoryivyurl}"Layout"Pattern",{Artifact' [Organisation]/[module]/[revision]/[type]s/[artifact]-[revision]. [ext] 'Ivy' [Organisation]/[module]/[revision]/[type]s/[artifact]. [ext] 'm2compatible=true}}}dependencies {compile' Org.slf4j:slf4j-api:1.7.21 'Compile ("Org.springframework.boot:spring-boot-starter-web:1.4.2.release")}task copyjars (Type:Copy) {from Configurations.runtime into' Build/libs/lib '} task Copyconfigs (type:Copy) {  /*From ' configs/' to ' Build/libs/configs '*/} task Generatejar (type: Jar, DependsOn: [Copyjars, Copyconfigs,Jar]) {manifest {attributes (' Implementation-title ': ' Gradle ', ' implementation-version ': Version, ' main-class ': ' Samp Le.main.Main ', ' Class-path ': configurations.compile.collect {' lib/' + It.getname ()}.Join(‘ ‘)} into (‘‘) { from"$buildDir/classes/main "include(' sample/')} into (‘‘) { from"$projectDir/src/main/resources "      }  }  
Build.gradle

Repositories configuration warehouse, the default Jcenter (), of course, you can also configure the local server dependencies;

5, Spring boot related configuration, reference: http://www.cnblogs.com/liangblog/p/5207855.html

----------------------------------------------------------------------------------------------------

Use the Spring boot project in Eclipse to build dependency management using Gradle

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.