build.gradle 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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. def framework_version = '0.9.0'
  18. compile "net.javapla.jawn:jawn-server-undertow:${framework_version}"
  19. // Database
  20. compile 'mysql:mysql-connector-java:5.1.38'
  21. //Logging
  22. runtime group: 'ch.qos.logback', name: 'logback-classic', version: '1.1.3' exclude group: 'org.slf4j'
  23. }
  24. /* ****************** */
  25. /* Application */
  26. /* ****************** */
  27. run {
  28. if(project.hasProperty('args')){
  29. args project.args.split(',')
  30. }
  31. jvmArgs = ['-server','-XX:+UseNUMA','-XX:+AggressiveHeap']//['-XX:+UseNUMA','-XX:+UseParallelGC','-XX:+AggressiveOpts']
  32. }
  33. applicationDistribution.from("webapp") {
  34. into "webapp"
  35. }
  36. /* ****************** */
  37. /* Eclipse */
  38. /* ****************** */
  39. eclipse {
  40. classpath {
  41. // we need the output dir to be the same as the one gradle uses when running Jetty
  42. // or else the dynamic loading does not apply
  43. defaultOutputDir = file('build/classes/main')
  44. }
  45. }