Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Troubleshooting Gradle and Apache Maven with De...

Troubleshooting Gradle and Apache Maven with Develocity

How much time do we spend daily troubleshooting our CI builds? Dependencies fail, infrastructure explodes, tests are flaky, Checkstyle turns Gandalf (“you shall not pass”), and everything “works on my machine.” Or not? There are many points of failure, and we always need proper tools.

In this talk, we will focus on developer tooling for Gradle and Apache Maven, specifically for troubleshooting and observability of local and CI builds. We will discuss Gradle features and Build Scans provided by Develocity. We will look at open-source projects using these tools and how they actually benefit from them. We will show examples from Gradle itself, Spring, JUnit, Kotlin, and other open source projects we host public instances for. Stay tuned for the interactive demo and its unplanned rapid disassembly!

P.S.: You can do the same with Bazel or sbt. Ask us how!

Oleg Nenashev

January 01, 2025
Tweet

More Decks by Oleg Nenashev

Other Decks in Technology

Transcript

  1. Hello, World! Stefan Wolf Build Scans Team / Jenkins plugins

    maintainer 4 Alex Semin Configuration Team / BT User Success Group Oleg Nenashev DevRel & Education Team / Dev Tools community builder
  2. Today, 2nd of December 6 • The Presentation and Demos

    - Live • Q&A after the presentation - Live • Any meetings/discussions - in Munich ◦ Share your Gradle Build Tool experiences with Alex ◦ Ask Stefan about Build Scans and Develocity ◦ Any questions about Gradle! • Later: Online meeting with other offices?
  3. Talk Outline • Some Mythbusters • Intro to Gradle Builds

    Troubleshooting • Show & Tell for Gradle and Apache Maven 7 The information contained in this presentation and the roadmap (and the "Roadmap") is intended to outline our general product direction, which is subject to change at any time. The content provided in this Roadmap is provided for informational purposes only and is not a commitment, promise or legal obligation to deliver any material, code, or functionality and should not be relied upon in making purchasing or other decisions. The development, release and timing of any features or functionality described in this Roadmap remains at the sole discretion of Gradle, Inc. Product capabilities, timeframes and features are subject to change and should not be viewed as commitments.
  4. Disclaimer 10 Gradle != Gradle Build Tool in this presentation

    It’s not a “Gradle vs Maven” talk Gradle is about both Maven and Gradle Build tool
  5. +

  6. 13 See ge.apache.org helps Used in Beam, Groovy, Kafka, Lucent,

    Pulsar, Solr, etc. • 37 onboarded projects • 31 days per week - savings from the build cache • 116 days per week - savings from all caching • 30k builds per week • 503d of total build time per week
  7. 16

  8. What do Gradle users say? (*) * based on user

    feedback, not Android specific
  9. DevelocityTM Build Scan® “X-Ray” for Gradle, Maven, Bazel, & sbt

    (CI & Local) Platform Flaky Test Management Build Scan & Comparison Performance & Failure Reporting Vulnerability & Compliance Reporting Out of the Box & Custom Reporting & Visualization Test Failure Analytics Benefits Test Distribution AI-Powered Predictive Test Selection Build Cache | Developer Productivity Platform Observability & Traceability Build & Test Acceleration Faster Troubleshooting
  10. We gave 20,000 developers back two hours per day by

    cutting Maven build and test times by over 60%. Top 3 Global Investment Bank
  11. For many FOSS projects: we sponsor Develocity licenses / SaaS

    hosting help with optimization and DPE Maven, Bazel and sbt users welcome! gradle/develocity-oss-projects gradle/develocity-oss-projects
  12. So, we… 1. Discover the issue 2. Analyze the issue

    3. Apply the fix 4. Verify the issue is gone 29
  13. So, we… 1. Discover the issue 2. Analyze the issue

    3. Apply the fix 4. Verify the issue is gone 30 Observability
  14. 31

  15. 32 Gradle Core Features • Gradle includes many troubleshooting capabilities

    • We work on improving reporting and stack traces • NEW: Problems API and reporting
  16. 35

  17. 37

  18. ◦ Build Scan and Troubleshooting ◦ Local and Distributed build

    caching ◦ Flaky test detection ◦ Local build observability ◦ // And more! 38 for Gradle and Apache Maven Troubleshooting
  19. a. Try it again b. Re-run it c. Re-run it

    again d. Ignore it and approve PR e. All of the above The test is flaky. What do you do now? 40
  20. Flaky test handling ⬢ Detection ◦ Test retries ◦ Develocity

    ⬢ Flaky tests don’t fail the build ⬢ Fixing ◦ New very flaky test on the spot ◦ Regular flaky fix-it days 42
  21. 51

  22. Live Demo: What can we show? • Analyzing slow smoke

    tests • Surfacing flaky tests in the Spring Boot or Armeria • Analyzing Build and Configuration cache speed • Discovering differences on CI generated jars causing integration tests to rerun - Micronaut, / Maven • /// and More! 53 gradle/develocity-oss-projects
  23. Build Time Reduced by 50% & Test Time by 60%

    Case Studies | Netflix Total test time reduced 60% Even Faster Total test time reduced 60% Build Time Dropped 50%!
  24. 110+ Days in CI and Local Test Savings with Predictive

    Test Selection in 30 Day Period L o c a l CI Serial testing time that could have been avoided (purple) vs unavoidable (gray) in a single day 33.3 days of serial testing time that could have been avoided if PTS was enabled 1.1M tests (42% of all tests) that could be avoided if PTS was used Local Builds CI Builds
  25. 14% of builds that have had at least 1 test

    fail 9% of builds that have had at least 1 flaky test (same test fails then passes in the same build) Sorting by Flaky column will show the test classes with the most flaky tests Flaky and Failed Tests Identification and Prioritization
  26. Test Times Before and After Develocity Test Distribution | 2

    Projects Case Studies | Netflix After Test Distribution Before Test Distribution Impact ◦ (2) Projects ◦ 33 Tasks ◦ Before: ◦ 1 hour 2 min ◦ After: ◦ 4 min 59 secs ◦ Savings: ◦ 57 min 1 sec
  27. What can you do? • Ask your DevEx team about

    Develocity ◦ Ongoing deploy/enablement • Share your feedback with us! • Learn Gradle Build Tool, Apache Maven and Develocity on DPE University 60
  28. References • Gradle Build Tool roadmap: https://roadmap.gradle.org/ • Develocity for

    Gradle Build Tool: gradle.com/gradle-enterprise-solutions/gradle-build-tool/ • Develocity fort Apache Maven: https://gradle.com/gradle-enterprise-solutions/maven-build-tool/ • Public Develocity instances for FOSS projects: https://gradle.com/customers/oss-projects/ 64