Skip to content

Instantly share code, notes, and snippets.

@aesteve
Last active August 29, 2015 14:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aesteve/ceb618a6fac63b62b2ad to your computer and use it in GitHub Desktop.
Save aesteve/ceb618a6fac63b62b2ad to your computer and use it in GitHub Desktop.
Multi-project Vert.x 3 + Gradle
if (!JavaVersion.current().java8Compatible) {
throw new IllegalStateException("This needs Java 8. You are using ${JavaVersion.current()}.")
}
buildscript {
repositories { jcenter() }
dependencies {
classpath 'com.github.jengelman.gradle.plugins:shadow:1.1.1'
}
}
allprojects {
apply plugin:'java'
apply plugin:'eclipse'
apply plugin: 'com.github.johnrengelman.shadow'
repositories {
mavenLocal()
mavenCentral()
maven { url 'http://oss.sonatype.org/content/repositories/snapshots/' }
}
}
//sourceCompatibility='1.8'
//targetCompatibility='1.8'
configure(rootProject) {
dependencies {
// vertx
compile 'io.vertx:vertx-core:3.0.0-SNAPSHOT'
compile 'io.vertx:vertx-apex:3.0.0-SNAPSHOT'
// services
compile project(':the-subproject')
}
shadowJar {
classifier = 'vertx'
manifest {
attributes 'Main-Class': 'io.vertx.core.Starter'
attributes 'Main-Verticle': 'java:MainVerticle'
}
mergeServiceFiles {
include 'META-INF/services/io.vertx.core.spi.VerticleFactory'
}
dependencies {
exclude(dependency('io.vertx:codegen'))
exclude(dependency('junit:junit'))
exclude(dependency('org.mvel:mvel2'))
}
}
task start(dependsOn: shadowJar) << {
javaexec { main="-jar"; args shadowJar.archivePath }
}
}
task wrapper(type: Wrapper) {
gradleVersion = '2.0'
}
project(':the-subproject') {
dependencies {
compile 'io.vertx:vertx-core:3.0.0-SNAPSHOT'
}
}
/* Content of settings.gradle :
includeFat 'the-subproject'
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment