/* * This build file was auto generated by running the Gradle 'init' task */ defaultTasks "clean", "build" ext { jackson2Version = "2.9.8" log4jVersion = "2.11.2" springVersion = "5.1.6.RELEASE" springSecurityVersion= "5.1.5.RELEASE" hibernateVersion = "5.4.2.Final" } // Apply the java plugin to add support for Java //apply plugin: 'java' allprojects { apply plugin: "java" apply plugin: "eclipse" //apply plugin: "pmd" //apply plugin: "findbugs" //apply plugin: "jdepend" sourceCompatibility = 1.8 targetCompatibility = 1.8 compileJava.options.encoding = 'UTF-8' eclipse { jdt { File f = file('.settings/org.eclipse.core.resources.prefs') f.write('eclipse.preferences.version=1\n') f.append('encoding/=UTF-8') }/* wtp { facet { facet name: 'jst.web', type: Facet.FacetType.fixed facet name: 'wst.jsdt.web', type: Facet.FacetType.fixed facet name: 'jst.java', type: Facet.FacetType.fixed facet name: 'jst.web', version: '3.0' facet name: 'jst.java', version: '1.7' facet name: 'wst.jsdt.web', version: '1.0' } }*/ } } // In this section you declare where to find the dependencies of your project repositories { // Use 'jcenter' for resolving your dependencies. // You can declare any Maven/Ivy/file repository here. mavenCentral() jcenter() } subprojects { sourceSets { main { java { srcDir 'src/main/java' // 指定源码目录 } resources { srcDir 'src/main/resources' //资源目录 } } } repositories { mavenLocal() mavenCentral() jcenter() maven { url "https://maven.eveoh.nl/content/repositories/releases" } maven { url "https://plugins.gradle.org/m2/" } maven { url "http://repo.spring.io/plugins-release" } maven { url "https://repo.spring.io/milestone" } maven { url "https://repo.spring.io/snapshot" } } dependencies { testCompile 'junit:junit:4.11' compileOnly 'junit:junit:4.11' testCompile group: 'javax.servlet', name: 'javax.servlet-api', version: '3.0.1' compileOnly group: 'javax.servlet', name: 'javax.servlet-api', version: '3.0.1' compileOnly group: 'javax.servlet', name: 'jstl', version: '1.2' compileOnly group: 'javax.servlet', name: 'jsp-api', version: '2.0' } jar { def currentTime = java.time.ZonedDateTime.now() manifest { attributes( "Implementation-Title": project.name, "Implementation-Vendor": project.vendor, "Created-By": project.group, "Implementation-Date": currentTime, "Implementation-Version": project.version) } } /* task checkenv<<{ //项目名 println project.name //项目相对路径 println project.path //项目描述 println project.description //项目的绝对路径 println project.projectDir //项目的build文件绝对路径 println project.buildDir //项目所在的group println project.group //项目的版本号 println project.version //项目的ant对象 println project.ant }*/ task copyjar2Release(type: Copy) { into "$rootDir/build/jars/" from "$buildDir/libs/" include '*.jar' } task copydemoWar2Release(type: Copy) { into "$rootDir/build/demowar/" from "$buildDir/libs/" include '*demo*.war' } task copyWar2Release(type: Copy) { into "$rootDir/build/" from "$buildDir/libs/" include '*web*.war' } task copyotherWar2Release(type: Copy) { into "$rootDir/build/" from "$buildDir/libs/" include '*i18n*.war' include '*browserlauncher*.war' } //task buildRelease(dependsOn:['build','war','copyjar2Release','copyWar2Release','copyotherWar2Release','copydemoWar2Release']) << { //task buildRelease(dependsOn:['copyjar2Release','copyWar2Release','copyotherWar2Release','copydemoWar2Release']) << { // println 'Build MaxKey '+project.name +' complete .' //} } // In this section you declare the dependencies for your production and test code dependencies { }