The Gradle build script for your project

To configure the Gradle build script for your project, perform the following steps:

  1. Go to the root directory of your project from the filesystem, create a file called build.gradle, and add the following content into the file and save it:
          apply plugin: 'war'
          apply plugin: 'eclipse-wtp'
          repositories {
                   mavenCentral() //add central maven repo to your buildfile
          }
    
          dependencies {
    
                  compile 'org.springframework:spring-webmvc:4.3.0.RELEASE',
    
                           'javax.servlet:jstl:1.2',
                           'org.springframework:spring-jdbc:4.3.0.RELEASE',
                           'org.hsqldb:hsqldb:2.3.2',
                           'commons-fileupload:commons-fileupload:1.2.2',
                           'org.apache.commons:commons-io:1.3.2',
                           'org.springframework:spring-oxm:4.3.0.RELEASE',
                           'org.codehaus.jackson:jackson-mapper-asl:1.9.10',
                           'com.fasterxml.jackson.core:jackson-databind:2.8.0',
                           'log4j:log4j:1.2.17',
                           'org.springframework.security:spring-security
                            -config:4.1.1.RELEASE',
                           'org.springframework.security:spring-security
                            -web:4.1.1.RELEASE',
                           'org.hibernate:hibernate-validator:5.2.4.Final',
                           'org.springframework.webflow:spring
                            -webflow:2.4.2.RELEASE',
                           'org.apache.tiles:tiles-extras:3.0.5'
    
                      providedCompile 'javax.servlet:javax.servlet-api:3.1.0'
    
                      testCompile 'junit:junit:4.12',
                                       'org.springframework:spring
                                        -test:4.3.0.RELEASE',
                                       'javax.servlet:jsp-api:2.0',
                                       'com.jayway.jsonpath:json-path
                                        -assert:2.2.0'
          }
  2. Now go to the root directory of your project from the command prompt and issue the following command:
          > gradle eclipse
    
  3. Next, open a new workspace in your STS, go to File | Import, select the Existing Projects into Workspace option from the tree list (you can find this option under the General node), and then click on the Next button.
  4. Click on the Browse button to select the root directory and locate your project directory. Click on OK and then on Finish.

Now, you will be able to see your project configured with the right dependencies in your STS.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.226.93.137