• gradle 4,构建java web程序


    在eclipse中,首先建一个gradle的工程,然后在工程上点击右键,properties,--》project facets,然后勾选Dynamic Web Module,Java,javascript。这三个。然后转换。再在gradle.build中修改如下,以下为完整代码。完毕后,在工程右键点击gradle,-->refresh,刷新即可让gradle下载类库。

    /*
     * This file was generated by the Gradle 'init' task.
     *
     * This generated file contains a sample Java Library project to get you started.
     * For more details take a look at the Java Libraries chapter in the Gradle
     * user guide available at https://docs.gradle.org/4.8.1/userguide/java_library_plugin.html
     */
     
    
    plugins {
        // Apply the java-library plugin to add support for Java Library
        id 'java-library'
        
    }
    
    dependencies {
     // struts library
        compile group: 'org.apache.struts', name: 'struts2-core', version: '2.3.24.1'
        compile 'org.apache.struts:struts2-spring-plugin:2.3.24.1'
        compile 'org.apache.struts:struts2-json-plugin:2.3.24.1'
     
        // spring library
        compile group: 'org.springframework', name: 'spring-core', version: '4.2.3.RELEASE'
        compile 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  
        compile group: 'org.hibernate', name: 'hibernate-core', version: '5.0.1.Final'
         
        // common library
        compile 'org.slf4j:slf4j-api:1.7.13'
        testCompile 'junit:junit:4.12'
    
        // This dependency is exported to consumers, that is to say found on their compile classpath.
        api 'org.apache.commons:commons-math3:3.6.1'
    
        // This dependency is used internally, and not exposed to consumers on their own compile classpath.
        implementation 'com.google.guava:guava:23.0'
    
        // Use JUnit test framework
        testImplementation 'junit:junit:4.12'
    }
    
    // In this section you declare where to find the dependencies of your project
    repositories {
        // Use jcenter for resolving your dependencies.
        // You can declare any Maven/Ivy/file repository here.
        jcenter()
    }
  • 相关阅读:
    适配iOS 10以及Xcode 8(转载)
    React-nwb的使用
    Android与JS混编(多图选择器)
    Android与JS混编(js调用android相机扫描二维码)
    Android与JS混编(js调用android相机)
    iOS: FFmpeg的使用
    UITableView/UICollectionView使用技巧
    IOS MapKit框架的使用(专门用于地图显示)
    iOS 地理编码 / 反地理编码
    iOS地图 -- 定位使用
  • 原文地址:https://www.cnblogs.com/sdgtxuyong/p/10339183.html
Copyright © 2020-2023  润新知