代码拉取完成,页面将自动刷新
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'
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。