A step-by-step tutorial demonstrating how to use Cursor AI coding agent alongside GitLab to incrementally modernize a Java 8 codebase to Java 21. The workflow covers three use cases: fixing a failing end-to-end test, setting up CI/CD quality gates using GitLab MCP for project context, and replacing the legacy HttpURLConnection API with Java 21's HttpClient. GitLab's Duo Agent Platform, MCP server, Code Review Flow, and CI/CD pipelines provide the safety guardrails that keep each agent-driven change scoped, reviewed, and traceable. Tips on AGENTS.md, review instructions, and reusable agentic skills are also included.
Table of contents
PrerequisitesFix a failing end-to-end test with CursorPrepare quality gates for Java 21 modernizationModernize HTTP connection handling with Java 21Tips for Cursor and GitLabSummary2.1K Impressions