Skip to content

Instantly share code, notes, and snippets.

@johnament
Created November 24, 2014 23:39
Show Gist options
  • Save johnament/444d430afff078de0cc6 to your computer and use it in GitHub Desktop.
Save johnament/444d430afff078de0cc6 to your computer and use it in GitHub Desktop.
How to configure gradle w/ CDI capabilities
apply plugin: 'java'
apply plugin: 'idea'
apply plugin:'application'
sourceCompatibility = '1.8'
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
// NetBeans will automatically add "run" and "debug" tasks relying on the
// "mainClass" property. You may however define the property prior executing
// tasks by passing a "-PmainClass=<QUALIFIED_CLASS_NAME>" argument.
//
// Note however, that you may define your own "run" and "debug" task if you
// prefer. In this case NetBeans will not add these tasks but you may rely on
// your own implementation.
if (!hasProperty('mainClass')) {
ext.mainClass = 'com.zanclus.example.Main'
}
project.ext.jettyVersion = '9.2.+'
project.ext.jerseyVersion = '2.9'
project.ext.deltaSpikeVersion = '1.0.2'
project.ext.weldVersion = '2.2.6.Final'
project.ext.restEasyVersion = '3.0.10.Final'
project.ext.mainClass = 'com.zanclus.example.Main'
mainClassName = project.ext.mainClass
repositories {
mavenCentral()
// You may define additional repositories, or even remove "mavenCentral()".
// Read more about repositories here:
// http://www.gradle.org/docs/current/userguide/dependency_management.html#sec:repositories
}
task wrapper(type: Wrapper) {
gradleVersion = '2.2-20141002220015+0000'
}
sourceSets {
main {
//if you truly want to override the defaults:
output.resourcesDir = 'build/out'
output.classesDir = 'build/out'
}
}
dependencies {
compile 'net.jcip:jcip-annotations:1.0'
compile 'log4j:log4j:1.2.17'
compile 'org.slf4j:slf4j-log4j12:1.7.7'
compile 'org.projectlombok:lombok:1.14.4'
compile 'commons-codec:commons-codec:1.9'
compile 'javax.websocket:javax.websocket-api:1.0'
compile 'commons-httpclient:commons-httpclient:3.1'
compile 'com.google.code.gson:gson:2.2.4'
compile 'javax.xml:jaxb-api:2.1'
compile 'commons-daemon:commons-daemon:1.0.13'
compile 'com.beust:jcommander:1.30'
compile "org.jboss.weld.se:weld-se:${weldVersion}"
compile "org.jboss.weld.servlet:weld-servlet:${weldVersion}"
compile "org.jboss.resteasy:resteasy-jaxrs:${restEasyVersion}"
compile "org.jboss.resteasy:resteasy-cdi:${restEasyVersion}"
compile "org.jboss.resteasy:resteasy-servlet-initializer:${restEasyVersion}"
compile "org.jboss.resteasy:jaxrs-api:${restEasyVersion}"
compile "org.eclipse.jetty.websocket:websocket-api:${jettyVersion}"
compile "org.eclipse.jetty:jetty-server:${jettyVersion}"
compile "org.eclipse.jetty:jetty-servlet:${jettyVersion}"
compile "org.eclipse.jetty:jetty-jsp:${jettyVersion}"
compile "org.eclipse.jetty:jetty-servlets:${jettyVersion}"
compile "org.eclipse.jetty.websocket:websocket-server:${jettyVersion}"
compile "org.eclipse.jetty.websocket:javax-websocket-server-impl:${jettyVersion}"
// TODO: Add dependencies here ...
// You can read more about how to add dependency here:
// http://www.gradle.org/docs/current/userguide/dependency_management.html#sec:how_to_declare_your_dependencies
testCompile group: 'junit', name: 'junit', version: '4.10'
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment