zoukankan      html  css  js  c++  java
  • gradle_学习_02_gradle多模块构建实例

    一、前言

    二、多模块构建

    1.工程结构

     父工程:weixin-service

    子模块:weixin-gz

                   weixin-qy

    2.父工程 weixin-service

    (1)build.gradle

    buildscript {
        ext {
            springBootVersion = '2.0.1.RELEASE'
        }
        repositories {
            maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
            //mavenCentral()
        }
        dependencies {
            classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
        }
    }
    
    //配置所有项目
    allprojects {
        //应用插件
        apply plugin: 'java'
        apply plugin: 'idea'
        apply plugin: 'org.springframework.boot'
        apply plugin: 'io.spring.dependency-management'
    
        //公共属性
        group = 'com.ray.weixin'
        version = '0.0.1-SNAPSHOT'
    
        //编译属性
        sourceCompatibility = 1.8
        targetCompatibility = 1.8
    
    }
    
    //构建依赖
    subprojects {
    
        repositories {
            maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
        }
    
        dependencies {
            compile('org.springframework.boot:spring-boot-starter-thymeleaf')
            compile('org.springframework.boot:spring-boot-starter-validation')
            compile('org.springframework.boot:spring-boot-starter-web')
            compileOnly('org.projectlombok:lombok')
    
            // 5. jackson
            compile ('com.alibaba:fastjson:1.2.44')
    
            //6. Redis
            compile('org.springframework.boot:spring-boot-starter-data-redis')
    
            //7.Quartz
            compile('org.springframework.boot:spring-boot-starter-quartz')
    
            testCompile('org.springframework.boot:spring-boot-starter-test')
        }
    }
    
    repositories {
        maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
    }
    View Code

    (2)settings.gradle

    rootProject.name = 'weixin-service'
    include 'weixin-gz'
    include 'weixin-qy'

    3.子模块 weixin-gz

    dependencies {
    
    }

    4.子模块 weixin-qy

    dependencies {
    
    }

    三、参考资料

    1.

  • 相关阅读:
    make menuconfig显示错误“Your display is too small to run Menuconfig!”
    程序员的那点事(转自java老师李明志)
    不必太羡慕别人
    把数据存储到 XML 文件
    关于session
    网页中的服务器端和客户端脚本
    没有一种成功是不经历磨砺的
    考试导数据总结(一)
    我们应该爱上“犯错”——读应试教育的死穴,恰在于堵死了孩子“犯错”的空间
    软考——多媒体
  • 原文地址:https://www.cnblogs.com/shirui/p/8876857.html
Copyright © 2011-2022 走看看