apply plugin: "java"
apply plugin: "eclipse"
apply plugin: "maven"
apply plugin: 'propdeps'
apply plugin: 'propdeps-eclipse'
apply plugin: 'propdeps-maven'
group = 'org.test'
version = "1.0"
description = "Test"
def jdkVersion = 1.8
buildscript {
def springIoGradleVersion = '0.5.4.RELEASE'
def propdepsVersion = '0.0.7'
repositories {
mavenLocal()
mavenCentral()
jcenter()
maven { url 'http://repo.spring.io/plugins-release' }
maven { url 'https://repository.jboss.org/nexus/content/groups/public/' }
}
dependencies {
//classpath "io.spring.gradle:dependency-management-plugin:$springIoGradleVersion"
classpath "org.springframework.build.gradle:propdeps-plugin:$propdepsVersion"
}
}
repositories {
mavenLocal()
mavenCentral()
jcenter()
maven { url 'http://repo.spring.io/plugins-release' }
maven { url 'https://repository.jboss.org/nexus/content/groups/public/' }
}
dependencies {
// mandatory dependencies for using Spock
provided "com.h2database:h2:1.4.182"
}
//----All subproject -----------
//-- Eclipse
eclipse.classpath.file {
withXml { xml ->
xml.asNode().findAll { it.@path.startsWith('src/test/') }.each { it.@output = 'test-bin' }
}
}
eclipse.jdt {
sourceCompatibility = jdkVersion
targetCompatibility = jdkVersion
}
eclipseClasspath {
dependsOn(cleanEclipse)
}
//--
task sourcesJar(type: Jar, dependsOn:classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
artifacts {
archives sourcesJar
}
转载于:https://my.oschina.net/frankies/blog/693362