build.gradle 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. apply plugin: 'java'
  2. apply plugin: 'eclipse'
  3. apply plugin: 'application'
  4. // compiler options
  5. sourceCompatibility = JavaVersion.VERSION_1_8
  6. targetCompatibility = JavaVersion.VERSION_1_8
  7. mainClassName = 'app.UndertowMain'
  8. repositories {
  9. mavenCentral()
  10. //snapshot repository - not actually needed to run this example
  11. maven {
  12. url 'http://oss.sonatype.org/content/repositories/snapshots'
  13. }
  14. }
  15. dependencies {
  16. // Framework
  17. compile 'net.javapla.jawn:jawn-server-undertow:0.8.10'
  18. // Database
  19. compile 'mysql:mysql-connector-java:5.1.37'
  20. //Logging
  21. runtime group: 'ch.qos.logback', name: 'logback-classic', version: '1.1.3' exclude group: 'org.slf4j'
  22. }
  23. /* ****************** */
  24. /* Application */
  25. /* ****************** */
  26. run {
  27. if(project.hasProperty('args')){
  28. args project.args.split(',')
  29. }
  30. jvmArgs = ['-XX:+UseNUMA','-XX:+UseParallelGC','-XX:+AggressiveOpts']
  31. }
  32. applicationDistribution.from("webapp") {
  33. into "webapp"
  34. }
  35. /* ****************** */
  36. /* Eclipse */
  37. /* ****************** */
  38. eclipse {
  39. classpath {
  40. // we need the output dir to be the same as the one gradle uses when running Jetty
  41. // or else the dynamic loading does not apply
  42. defaultOutputDir = file('build/classes/main')
  43. }
  44. }