build.gradle.kts 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. plugins {
  2. id("otel.javaagent-instrumentation")
  3. }
  4. muzzle {
  5. pass {
  6. group.set("org.apache.tomcat")
  7. module.set("tomcat-jasper")
  8. // version range [7.0.0,7.0.19) is missing from maven
  9. // tomcat 10 uses JSP 3.0
  10. versions.set("[7.0.19,10)")
  11. // version 8.0.9 depends on org.eclipse.jdt.core.compiler:ecj:4.4RC4 which does not exist
  12. skip("8.0.9")
  13. }
  14. }
  15. dependencies {
  16. // compiling against tomcat 7.0.20 because there seems to be some issues with Tomcat's dependency < 7.0.20
  17. compileOnly("org.apache.tomcat:tomcat-jasper:7.0.20")
  18. compileOnly("javax.servlet.jsp:javax.servlet.jsp-api:2.3.0")
  19. compileOnly("javax.servlet:javax.servlet-api:3.1.0")
  20. testInstrumentation(project(":instrumentation:servlet:servlet-3.0:javaagent"))
  21. testInstrumentation(project(":instrumentation:servlet:servlet-javax-common:javaagent"))
  22. // using tomcat 7.0.37 because there seems to be some issues with Tomcat's jar scanning in versions < 7.0.37
  23. // https://stackoverflow.com/questions/23484098/org-apache-tomcat-util-bcel-classfile-classformatexception-invalid-byte-tag-in
  24. testLibrary("org.apache.tomcat.embed:tomcat-embed-core:7.0.37")
  25. testLibrary("org.apache.tomcat.embed:tomcat-embed-logging-juli:7.0.37")
  26. testLibrary("org.apache.tomcat.embed:tomcat-embed-jasper:7.0.37")
  27. latestDepTestLibrary("javax.servlet.jsp:javax.servlet.jsp-api:+")
  28. latestDepTestLibrary("javax.servlet:javax.servlet-api:+")
  29. latestDepTestLibrary("org.apache.tomcat.embed:tomcat-embed-core:9.+")
  30. latestDepTestLibrary("org.apache.tomcat.embed:tomcat-embed-jasper:9.+")
  31. latestDepTestLibrary("org.apache.tomcat.embed:tomcat-embed-logging-juli:9.+")
  32. }
  33. tasks.withType<Test>().configureEach {
  34. // skip jar scanning using environment variables:
  35. // http://tomcat.apache.org/tomcat-7.0-doc/config/systemprops.html#JAR_Scanning
  36. // having this set allows us to test with old versions of the tomcat api since
  37. // JarScanFilter did not exist in the tomcat 7 api
  38. jvmArgs("-Dorg.apache.catalina.startup.ContextConfig.jarsToSkip=*")
  39. jvmArgs("-Dorg.apache.catalina.startup.TldConfig.jarsToSkip=*")
  40. // required on jdk17
  41. jvmArgs("--add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED")
  42. jvmArgs("--add-opens=java.base/java.util=ALL-UNNAMED")
  43. jvmArgs("-XX:+IgnoreUnrecognizedVMOptions")
  44. // TODO run tests both with and without experimental span attributes
  45. jvmArgs("-Dotel.instrumentation.jsp.experimental-span-attributes=true")
  46. jvmArgs("-Dotel.instrumentation.common.experimental.view-telemetry.enabled=true")
  47. }