首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >gradle_学习_02_gradle多模块构建实例

gradle_学习_02_gradle多模块构建实例

作者头像
shirayner
发布2018-08-10 10:13:19
2710
发布2018-08-10 10:13:19
举报
文章被收录于专栏:Java成神之路Java成神之路

一、前言

二、多模块构建

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/' }
}

(2)settings.gradle

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

3.子模块 weixin-gz

dependencies {

}

4.子模块 weixin-qy

dependencies {

}

三、参考资料

1.

本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2018-04-18 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 一、前言
  • 二、多模块构建
    • 1.工程结构
      • 2.父工程 weixin-service
        • 3.子模块 weixin-gz
          • 4.子模块 weixin-qy
          • 三、参考资料
          相关产品与服务
          云数据库 Redis
          腾讯云数据库 Redis(TencentDB for Redis)是腾讯云打造的兼容 Redis 协议的缓存和存储服务。丰富的数据结构能帮助您完成不同类型的业务场景开发。支持主从热备,提供自动容灾切换、数据备份、故障迁移、实例监控、在线扩容、数据回档等全套的数据库服务。
          领券
          问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档