Skip to content

Instantly share code, notes, and snippets.

@monzou
Created February 17, 2013 09:59
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save monzou/4970854 to your computer and use it in GitHub Desktop.
Save monzou/4970854 to your computer and use it in GitHub Desktop.
Eclipse + Gradle Multi Project (flat layout)
apply plugin: 'eclipse'
subprojects {
apply plugin: 'java'
apply plugin: 'eclipse-wtp'
jdkVersion = 1.7
sourceCompatibility = jdkVersion
targetCompatibility = jdkVersion
version = '0.1'
vendor = 'usopla.com'
repositories {
mavenCentral()
}
dependencies {
compile group: 'com.google.guava', name: 'guava', version: '13.0.1'
testCompile 'junit:junit:4.8.2'
}
jar {
manifest.attributes provider: 'gradle'
manifest.attributes 'Implementation-Vendor-Id': vendor
manifest.attributes 'Implementation-Vendor': vendor
manifest.attributes 'Implementation-Version': version
}
eclipse {
classpath {
file {
whenMerged { classpath ->
classpath.configure classpath.entries.grep { entry ->
!(entry instanceof org.gradle.plugins.ide.eclipse.model.Library)
}
}
}
}
}
task mkdirs << {
["src/main/java", "src/main/resources", "src/test/java", "src/test/resources"].each {
def path = "${projectDir}/${it}"
ant.mkdir(dir: path)
ant.touch(file: "${path}/.gitkeep")
}
}
}
task wrapper(type: Wrapper) {
gradleVeresion = '1.4'
}
apply plugin: 'war'
dependencies {
providedCompile 'javax.servlet:servlet-api:2.5'
compile project(':api')
compile project(':service')
}
war {
manifest.attributes = jar.manifest.attributes
manifest.attributes 'Implementation-Title': 'web'
}
includeFlat "util", "model", "persistence", "service", "api", "web"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment