以前整理,,每一個人環境不一樣僅供參考java
以下mysql
include 'tools-common:tools-common-base'
findProject(':tools-common:tools-common-base')?.name = 'tools-common-base'
include 'tools-common:tools-common-core'
findProject(':tools-common:tools-common-core')?.name = 'tools-common-core'
include 'tools-common:tools-common-jpa'
findProject(':tools-common:tools-common-jpa')?.name = 'tools-common-jpa'
複製代碼
增長spring
plugins {
id 'java'
id 'org.springframework.boot' version '2.1.3.RELEASE'
id 'com.bmuschko.docker-spring-boot-application' version '4.6.2'
}
apply plugin: 'com.bmuschko.docker-spring-boot-application'
//排除父項目打包docker
if (project.subprojects) {
jar.enabled = false
bootJar {
enabled = false
}
dockerCreateDockerfile {
enabled = false
}
dockerBuildImage {
enabled = false
}
}
複製代碼
subprojects {
apply plugin: 'java-library'
dockerCreateDockerfile {
enabled = false
}
dockerBuildImage {
enabled = false
}
}
複製代碼
dependencies {
implementation 'mysql:mysql-connector-java:8.0.15'
implementation "org.springframework.boot:spring-boot-starter-data-jpa:${springBootVersion}"
implementation project(":${toolsCommon}:${toolsCommonJpa}")
}
docker {
springBootApplication {
baseImage = 'openjdk:8-alpine'
//指定外端口映射到docker內端口
ports = [8769, 8769]
}
}
dockerSyncBuildContext {
doFirst {
copy {
from("../${toolsCommon}/${toolsCommonJpa}/build/classes/java/main/store/zabbix/common")
into('./build/classes/java/main/store/zabbix/common')
}
}
}
複製代碼