1 Star 0 Fork 5

ZMH/db-elasticsearch-xxjob

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
build.gradle 4.88 KB
一键复制 编辑 原始数据 按行查看 历史
def profile = System.getProperty("profile") ?: "dev"
println(profile)
configure(allprojects) { project ->
group = PROJ_GROUP
version = PROJ_VERSION
apply plugin: "java"
apply plugin: "maven-publish"
apply plugin: "eclipse"
apply plugin: "idea"
apply plugin: "signing"
apply plugin: "java-library"
eclipse {
jdt {
//if you want to alter the java versions (by default they are configured with gradle java plugin settings):
sourceCompatibility = SOURCE_COMPILER_LEVEL
targetCompatibility = TARGET_COMPILER_LEVEL
//javaRuntimeName = "../../org.eclipse.jdt.launching.JRE_CONTAINER"
}
}
tasks.withType(JavaCompile) {
sourceCompatibility = SOURCE_COMPILER_LEVEL
targetCompatibility = TARGET_COMPILER_LEVEL
options.encoding = 'UTF-8'
}
tasks.withType(Javadoc) {
sourceCompatibility = JAVADOC_SOURCE_LEVEL
targetCompatibility = JAVADOC_COMPILER_LEVEL
options.encoding = 'UTF-8'
// disable the crazy super-strict doclint tool in Java 8
// noinspection SpellCheckingInspection
if (JavaVersion.current().isJava8Compatible()) {
options.addStringOption('Xdoclint:none', '-quiet')
}
}
task sourcesJar(type: Jar) {
archiveClassifier = "sources"
from sourceSets.main.allJava
duplicatesStrategy = DuplicatesStrategy.INCLUDE
}
processResources {
duplicatesStrategy = DuplicatesStrategy.INCLUDE
}
task javaDocJar(type: Jar, dependsOn: javadoc) {
archiveClassifier = "javadoc"
from javadoc.destinationDir
}
artifacts {
archives sourcesJar, javaDocJar
}
jar {
manifest {
attributes (
'Implementation': archiveVersion,
'Specification-Version': archiveVersion,
'Implementation-Vendor': 'bbossgroups',
'Implementation-ProductID': project.name,
'Compile-Timestamp': new Date().format('yyyy-MM-dd HH:mm:ss'),
'Compile-User': DEVELOPER_NAME
)
}
}
repositories {
mavenLocal()
mavenCentral()
}
if(project.getProperty('skipTest').equals("true"))
{
compileTestJava.enabled=false
processTestResources.enabled=false
testClasses.enabled = false
test.enabled = false
}
sourceSets {
main {
java {
srcDir 'src/main/java'
}
if(profile == "dev") {
resources {
srcDir 'src/main/resources'
srcDir 'src/main/java' exclude '**/*.java'
}
}
else{
resources {
srcDir 'src/main/resources' exclude '**/*'
srcDir 'src/main/java' exclude '**/*.java'
}
}
// compileClasspath = configurations.api + configurations.runtime
}
test {
java {
srcDir 'src/test/java'
}
resources {
srcDir 'src/test/resources'
srcDir 'src/test/java' exclude '**/*.java'
}
}
}
configurations {
//屏蔽log4j
api.exclude group: 'org.slf4j', module: 'slf4j-log4j12'
}
dependencies {
testImplementation 'junit:junit:4.13.1'
//采用log4j2记录日志
api(
[group: 'org.apache.logging.log4j', name: 'log4j-api', version: "${log4j2_version}", transitive: false],
[group: 'org.apache.logging.log4j', name: 'log4j-core', version: "${log4j2_version}", transitive: false],
[group: 'org.apache.logging.log4j', name: 'log4j-slf4j-impl', version: "${log4j2_version}", transitive: true],
[group: 'org.apache.logging.log4j', name: 'log4j-slf4j-impl', version: "${log4j2_version}", transitive: true]
)
api(
[group: 'com.bbossgroups.plugins', name: 'bboss-datatran-jdbc', version: "${bboss_es_version}", transitive: true],
[group: 'com.bbossgroups', name: 'bboss-schedule', version: "${bboss_version}", transitive: true],
)
api 'com.xuxueli:xxl-job-core:2.1.1'
// api 'org.apache-extras.beanshell:bsh:2.0b6'
api 'org.xerial:sqlite-jdbc:3.45.1.0'
api 'mysql:mysql-connector-java:8.0.33'
api(
[group: 'com.bbossgroups', name: 'bboss-bootstrap-rt', version: "${bboss_version}", transitive: true],
)
api (
fileTree(dir: 'lib', include: '*.jar')
)
}
task copyJarFiles(type: Sync,dependsOn:'jar'){
from configurations.api{
canBeResolved=true
}
from jar.outputs
exclude { details -> details.file.name.startsWith('bboss-rt') }
into 'build/dist/lib'
}
task copyRTJarFiles(type: Copy,dependsOn:'copyJarFiles'){
from configurations.api{
canBeResolved=true
}
include { details -> details.file.name.startsWith('bboss-rt') }
into 'build/dist'
rename ("bboss-rt-${bboss_version}.jar", "${project.name}-${bboss_version}.jar")
}
task copyToolFiles(type: Copy ,dependsOn:'copyRTJarFiles') {
from ('runfiles')
{
expand(
bboss_version:"${bboss_version}",
project:"${project.name}"
)
}
filteringCharset = 'UTF-8'
into 'build/dist/'
}
task copyResourcesfiles(type: Sync ) {
from fileTree(dir: 'src/main/resources')
filteringCharset = 'UTF-8'
into 'build/dist/resources'
}
task releaseVersion(type: Zip,dependsOn:['copyToolFiles','copyResourcesfiles']) {
//appendix = 'wrapper'
archiveClassifier = 'released'
from 'build/dist/'
}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Java
1
https://gitee.com/Z-MH/db-elasticsearch-xxjob.git
git@gitee.com:Z-MH/db-elasticsearch-xxjob.git
Z-MH
db-elasticsearch-xxjob
db-elasticsearch-xxjob
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385