79 Star 420 Fork 111

baomidou / jobs

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
build.gradle 6.98 KB
一键复制 编辑 原始数据 按行查看 历史
import java.text.SimpleDateFormat
buildscript {
repositories {
maven { url "https://maven.aliyun.com/nexus/content/groups/public" }
mavenCentral()
maven { url "https://plugins.gradle.org/m2/" }
}
dependencies {
classpath "gradle.plugin.com.hierynomus.gradle.plugins:license-gradle-plugin:0.15.0"
}
}
ext {
configuration = [
javaVersion = JavaVersion.VERSION_1_8
]
libraries = [
mybatisPlusVersion = '3.2.0',
jobsVersion = '1.0.3.3-SNAPSHOT',
springBootVersion = '2.2.0.RELEASE',
springVersion = '5.2.0.RELEASE',
nettyAllVersion = '4.1.43.Final',
disruptorVersion = '3.4.2',
hessianVersion = '4.0.62',
junitVersion = '5.4.0',
]
lib = [
"aspectjrt" : "org.aspectj:aspectjrt:1.8.13",
"cglib" : "cglib:cglib:3.2.6",
"lombok" : "org.projectlombok:lombok:1.18.10",
"commons-exec" : "org.apache.commons:commons-exec:1.3",
"mybatis-plus-boot-starter": "com.baomidou:mybatis-plus-boot-starter:${mybatisPlusVersion}",
"jobs-spring-boot-starter" : "com.baomidou:jobs-spring-boot-starter:${jobsVersion}",
"cron-utils" : "com.cronutils:cron-utils:9.0.2",
"mysql-connector-java" : "mysql:mysql-connector-java:8.0.16",
"p6spy" : "p6spy:p6spy:3.8.2",
"netty-all" : "io.netty:netty-all:${nettyAllVersion}",
"disruptor" : "com.lmax:disruptor:${disruptorVersion}",
"hessian" : "com.caucho:hessian:${hessianVersion}",
"javax.servlet-api" : "javax.servlet:javax.servlet-api:4.0.1",
"aspectjweaver" : "org.aspectj:aspectjweaver:1.9.2",
"mockito" : "org.mockito:mockito-core:2.24.0",
"slf4j-api" : "org.slf4j:slf4j-api:1.7.25",
"h2" : "com.h2database:h2:1.4.197",
"mysql" : "mysql:mysql-connector-java:8.0.15"
]
}
allprojects {
group = 'com.baomidou'
version = "1.0.3.3-SNAPSHOT"
}
description = "jobs 分布式任务调度平台"
subprojects {
apply plugin: 'java-library'
apply plugin: 'signing'
apply plugin: 'maven-publish'
sourceCompatibility = "${javaVersion}"
targetCompatibility = "${javaVersion}"
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
options.deprecation = true
options.compilerArgs += ["-parameters"]
}
jar {
afterEvaluate {
manifest {
attributes 'Implementation-Version': version
attributes 'Built-Gradle': gradle.gradleVersion
attributes 'Bundle-DocURL': 'https://mybatis.plus/'
attributes 'Build-OS': System.getProperty("os.name")
attributes 'Built-By': System.getProperty("user.name")
attributes 'Build-Jdk': System.getProperty("java.version")
attributes 'Build-Timestamp': new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date())
}
}
}
repositories {
mavenLocal()
maven { url "https://maven.aliyun.com/repository/public" }
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
jcenter()
}
dependencies {
annotationProcessor "${lib.lombok}"
compileOnly "${lib.lombok}"
testAnnotationProcessor "${lib.lombok}"
testCompileOnly "${lib.lombok}"
}
//noinspection GroovyAssignabilityCheck
task sourcesJar(type: Jar) {
archiveClassifier = 'sources'
from sourceSets.main.allJava
}
javadoc {
afterEvaluate {
configure(options) {
encoding "UTF-8"
charSet 'UTF-8'
author true
version true
failOnError false
links "http://docs.oracle.com/javase/8/docs/api"
}
}
}
task javadocJar(type: Jar) {
archiveClassifier = 'javadoc'
from javadoc
}
tasks.whenTaskAdded { task ->
if (task.name.contains('signMavenJavaPublication')) {
task.enabled = new File(project.property('signing.secretKeyRingFile') as String).isFile()
}
}
publishing {
repositories {
maven {
def userName = System.getProperty("un")
def passWord = System.getProperty("ps")
def releasesRepoUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
def snapshotsRepoUrl = "https://oss.sonatype.org/content/repositories/snapshots/"
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
credentials {
username userName
password passWord
}
}
}
publications {
mavenJava(MavenPublication) {
from components.java
artifact sourcesJar
artifact javadocJar
pom {
name = 'jobs'
packaging 'jar'
description = 'An enhanced toolkit of Mybatis to simplify development.'
url = 'https://github.com/baomidou/jobs'
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/baomidou/jobs'
}
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id = 'baomidou'
name = 'hubin'
email = 'jobob@qq.com'
}
}
withXml {
def root = asNode()
root.dependencies.'*'.findAll {
def d = it
d.scope.text() == 'runtime' && project.configurations.findByName("implementation").allDependencies.find { dep ->
dep.name == it.artifactId.text()
}.each() {
d.scope*.value = 'compile'
d.appendNode('optional', true)
}
}
}
}
}
}
signing {
sign publishing.publications.mavenJava
}
}
}
Java
1
https://gitee.com/baomidou/jobs.git
git@gitee.com:baomidou/jobs.git
baomidou
jobs
jobs
master

搜索帮助