215 lines
6.1 KiB
Groovy
215 lines
6.1 KiB
Groovy
// 编译脚本
|
|
buildscript {
|
|
ext {
|
|
springBootVersion = "2.7.0"
|
|
mybatisPlusVersion = "3.5.5"
|
|
solonVersion = "2.7.2"
|
|
}
|
|
|
|
// 仓库配置
|
|
repositories {
|
|
mavenLocal()
|
|
maven { url 'https://maven.aliyun.com/repository/central' }
|
|
maven { url 'https://maven.aliyun.com/repository/spring' }
|
|
maven { url 'https://maven.aliyun.com/repository/google' }
|
|
maven { url 'https://repo.spring.io/release' }
|
|
maven { url 'https://repo.spring.io/milestone' }
|
|
mavenCentral()
|
|
}
|
|
|
|
dependencies {
|
|
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
|
|
}
|
|
}
|
|
|
|
description = "FlowLong BPM"
|
|
|
|
// 项目配置
|
|
allprojects {
|
|
group "com.aizuda"
|
|
version "0.0.7"
|
|
}
|
|
|
|
|
|
// 子模块配置
|
|
subprojects {
|
|
apply plugin: 'java-library'
|
|
apply plugin: 'maven-publish'
|
|
apply plugin: 'signing'
|
|
apply plugin: "io.spring.dependency-management"
|
|
|
|
tasks.withType(JavaCompile).configureEach {
|
|
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:-serial"
|
|
options.encoding = 'UTF-8'
|
|
options.warnings = false
|
|
}
|
|
|
|
tasks.named('test') {
|
|
useJUnitPlatform()
|
|
}
|
|
|
|
// 仓库配置
|
|
repositories {
|
|
mavenLocal()
|
|
maven { url 'https://maven.aliyun.com/repository/central' }
|
|
maven { url 'https://maven.aliyun.com/repository/spring' }
|
|
maven { url 'https://maven.aliyun.com/repository/google' }
|
|
maven { url 'https://repo.spring.io/release' }
|
|
maven { url 'https://repo.spring.io/milestone' }
|
|
maven { url 'https://repo.spring.io/snapshot' }
|
|
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
|
|
mavenCentral()
|
|
}
|
|
|
|
// 依赖管理
|
|
dependencyManagement {
|
|
imports {
|
|
mavenBom "org.springframework.boot:spring-boot-dependencies:${springBootVersion}"
|
|
}
|
|
|
|
dependencies {
|
|
dependency("mysql:mysql-connector-java:8.0.32")
|
|
|
|
// orm db
|
|
dependency("com.baomidou:mybatis-plus-boot-starter:${mybatisPlusVersion}")
|
|
dependency("com.baomidou:mybatis-plus-core:${mybatisPlusVersion}")
|
|
|
|
}
|
|
}
|
|
|
|
// 依赖配置
|
|
dependencies {
|
|
// 日志
|
|
api("org.slf4j:slf4j-api")
|
|
|
|
// lombok
|
|
compileOnly("org.projectlombok:lombok")
|
|
annotationProcessor("org.projectlombok:lombok")
|
|
testAnnotationProcessor("org.projectlombok:lombok")
|
|
testCompileOnly("org.projectlombok:lombok")
|
|
|
|
// junit
|
|
testCompileOnly("org.springframework.boot:spring-boot-starter-test")
|
|
}
|
|
|
|
tasks.named('test') {
|
|
useJUnitPlatform()
|
|
}
|
|
|
|
// 编译环境 JDK-1.8+
|
|
sourceCompatibility = JavaVersion.VERSION_1_8
|
|
targetCompatibility = JavaVersion.VERSION_1_8
|
|
|
|
tasks.withType(JavaCompile).configureEach {
|
|
options.encoding = 'UTF-8'
|
|
options.warnings = false
|
|
options.deprecation = true
|
|
options.compilerArgs += ["-parameters"]
|
|
}
|
|
|
|
tasks.withType(GenerateModuleMetadata).configureEach {
|
|
enabled = false
|
|
}
|
|
|
|
tasks.register('sourcesJar', Jar) {
|
|
dependsOn classes
|
|
archiveClassifier = 'sources'
|
|
from sourceSets.main.allSource
|
|
}
|
|
|
|
javadoc {
|
|
options {
|
|
encoding "UTF-8"
|
|
charSet 'UTF-8'
|
|
author true
|
|
version true
|
|
failOnError false
|
|
links "https://docs.oracle.com/javase/8/docs/api"
|
|
}
|
|
}
|
|
|
|
tasks.withType(MavenPublication).configureEach {
|
|
doFirst {
|
|
options.skipCertificateChecks = true
|
|
}
|
|
}
|
|
|
|
tasks.register('javadocJar', Jar) {
|
|
archiveClassifier = 'javadoc'
|
|
from javadoc
|
|
}
|
|
|
|
tasks.configureEach { task ->
|
|
if (task.name.contains('signMavenJavaPublication')) {
|
|
task.enabled = new File(project.property('signing.secretKeyRingFile') as String).isFile()
|
|
}
|
|
}
|
|
|
|
publishing {
|
|
repositories {
|
|
maven {
|
|
name = "OSSRH"
|
|
def releasesRepoUrl = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
|
|
def snapshotsRepoUrl = "https://s01.oss.sonatype.org/content/repositories/snapshots/"
|
|
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
|
|
|
|
credentials {
|
|
username = "andto"
|
|
password = "243194995"
|
|
}
|
|
}
|
|
}
|
|
publications {
|
|
mavenJava(MavenPublication) {
|
|
from components.java
|
|
|
|
artifact sourcesJar
|
|
artifact javadocJar
|
|
|
|
pom {
|
|
name = 'flowlong'
|
|
packaging 'jar'
|
|
description = 'flowlong bpm engine'
|
|
url = 'https://github.com/aizuda/flowlong'
|
|
|
|
scm {
|
|
connection = 'scm:git@github.com:Codearte/gradle-nexus-staging-plugin.git'
|
|
developerConnection = 'scm:git@github.com:Codearte/gradle-nexus-staging-plugin.git'
|
|
url = 'https://github.com/aizuda/flowlong'
|
|
}
|
|
|
|
licenses {
|
|
license {
|
|
name = 'The AGPL License, Version 3.0'
|
|
url = 'https://www.gnu.org/licenses/agpl-3.0'
|
|
}
|
|
}
|
|
|
|
developers {
|
|
developer {
|
|
id = 'aizuda'
|
|
name = '青苗'
|
|
email = 'jobob@qq.com'
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
signing {
|
|
useInMemoryPgpKeys(System.getenv('GPG_SECRET'), System.getenv('GPG_PASSWORD'))
|
|
sign publishing.publications.mavenJava
|
|
}
|
|
}
|
|
|
|
// 编译任务忽略案例模块
|
|
afterEvaluate { project ->
|
|
if (project.name == 'flowlong-spring-boot-example') {
|
|
project.tasks.all {
|
|
it.enabled = false
|
|
}
|
|
}
|
|
}
|
|
}
|