1 Star 5 Fork 0

adrninistrator/IDEA-IC-Tomcat

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
build.gradle 3.57 KB
一键复制 编辑 原始数据 按行查看 历史
Adrninistrator 提交于 2020-03-07 13:17 . modify Gradle script
group 'com.test'
version '1.0.0'
apply plugin: 'war'
apply plugin: 'eclipse-wtp'
def projectName = 'IDEA-IC-Tomcat'
description = "IDEA-IC-Tomcat subsystem"
version = "1.0.0"
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
repositories {
mavenCentral()
}
configurations {
implementation.exclude module: 'slf4j-log4j12'
implementation.exclude module: 'log4j'
implementation.exclude module: 'commons-logging'
implementation.exclude module: 'jsp-api'
}
sourceSets {
main {
java {
srcDir 'src/main/java'
}
resources {
srcDir 'src/main/resources'
}
}
test {
java {
srcDir 'src/unit.test/java'
}
resources {
srcDir 'src/unit.test/resources'
}
}
}
clean {
delete 'dist'
delete 'build'
}
processResources {
setDuplicatesStrategy(DuplicatesStrategy.INCLUDE)
}
processTestResources {
setDuplicatesStrategy(DuplicatesStrategy.INCLUDE)
}
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
}
List servlet = ['javax.servlet:javax.servlet-api:4.0.0']
def spring_version = "4.3.16.RELEASE"
List junit = [
"junit:junit:4.12",
"org.springframework:spring-test:$spring_version"
]
List spring = [
"org.springframework:spring-web:$spring_version",
"org.springframework:spring-aspects:$spring_version",
"org.springframework:spring-webmvc:$spring_version",
"org.springframework:spring-context-support:$spring_version"
]
List log4jweb = ['org.apache.logging.log4j:log4j-web:2.8.2']
def jackson_ver = "2.9.4"
List jackson = [
"com.fasterxml.jackson.core:jackson-databind:$jackson_ver",
"com.fasterxml.jackson.module:jackson-module-jaxb-annotations:$jackson_ver"
]
List disruptor = ['com.lmax:disruptor:3.3.7']
List logger = [
'org.apache.logging.log4j:log4j-api:2.9.1',
'org.apache.logging.log4j:log4j-core:2.9.1',
'org.apache.logging.log4j:log4j-slf4j-impl:2.9.1',
"org.slf4j:jcl-over-slf4j:1.7.28"
]
dependencies {
implementation spring, log4jweb, jackson, disruptor, logger
providedCompile servlet
testImplementation servlet, junit
}
compileJava.dependsOn clean
compileJava.options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
war {
// 去掉和 Web 容器冲突的包(容器启动会报 Warning),不能直接用 exclude,因为 jar 包不属于 Resources
rootSpec.exclude '**/javax.el-api*.jar'
manifest {
attributes 'Implementation-Title': project.description
attributes 'Build-By': System.getProperty('user.name')
attributes 'Build-Time': new Date().format("yyyy-MM-dd HH:mm:ss")
attributes 'Source-Compatibility': project.sourceCompatibility
attributes 'Target-Compatibility': project.targetCompatibility
}
doLast {
mkdir('dist/apps')
file(destinationDirectory.get().toString() + "/" + archiveFileName.get().toString())
.renameTo(file("dist/apps/" + projectName + ".war"))
}
}
task createJavaProject {
doLast {
sourceSets*.java.srcDirs*.each { it.mkdirs() }
sourceSets*.resources.srcDirs*.each { it.mkdirs() }
}
}
task testTask {
doFirst {
println "测试-" + System.getProperty("arg")
}
}
apply from: 'runTomcat.gradle'
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Java
1
https://gitee.com/adrninistrator/IDEA-IC-Tomcat.git
git@gitee.com:adrninistrator/IDEA-IC-Tomcat.git
adrninistrator
IDEA-IC-Tomcat
IDEA-IC-Tomcat
master

搜索帮助