Modernising a legacy Java EE app with AWS Transform custom: Java 25, Spring Boot, and React in four steps
Java 11, a WildFly EAR, AngularJS 1.5, and a dependency list full of end-of-life libraries. Sound familiar? This walkthrough modernises that stack to Java 25, Spring Boot, and React with four AWS-managed transformations in AWS Transform custom, run from the command line. You see what each step changes, how it was verified, and what it cost in agent minutes.
Specialist SA for Modernisation
Every enterprise has them: Java applications written a decade ago, still running the business, still on the stack they were built for. Java 11, EJBs in a WildFly EAR, an AngularJS front end, a dependency list full of end-of-life libraries. They work, so they stay, and the cost of modernising them by hand, reading every class, preserving every behaviour, keeps the project off the roadmap year after year.
This post takes one such application and modernises it end to end with AWS Transform custom. It starts by analysing the codebase to surface the work, then runs three transformations: Java 11 to Java 25 with Jakarta EE 10, a WildFly EAR to a single Spring Boot service, and an AngularJS 1.x front end to React 18 with TypeScript. Each one is a reviewable change produced by AWS Transform custom and driven from the command line, with a coding assistant such as Kiro or Claude Code orchestrating. The result is a Java 25 Spring Boot application with a React front end. The walkthrough shows that AWS Transform custom does the work, and how you confirm at each step that the app still does what it did before.
The specimen
The starting point is an application built to be legacy on purpose: an inventory-management system of about 5,000 lines, packaged as a three-module Maven EAR (
inventory-ejb , inventory-web , inventory-ear ) running on WildFly 18 under Java 11. Six backend services (product, customer, order, invoice, notification, reporting) are exposed as JAX-RS resources backed by @Stateless EJBs and JPA entities, and consumed by an AngularJS 1.5 single-page app. The whole backend uses the pre-Jakarta javax.* namespace, which guarantees a javax.* to jakarta.* rename later. It ships with 69 JUnit 4 and Mockito unit tests.The dependencies were chosen to be the kind a modernisation (and security) scanner should flag:
Library | Version | Status |
|---|---|---|
Log4j | 1.2.17 | End of life since 2015, superseded by Log4j 2 |
Apache Commons Lang | 2.6 | Superseded by commons-lang3 |
Jackson Databind | 2.9.10 | Old line with known CVEs |
Apache Commons HttpClient | 3.1 | End of life, superseded by HttpComponents |
JAXB RI ( javax.xml.bind ) | 2.3.0 | Legacy standalone JAXB |
JUnit | 4.11 | Old 4.x line |
AngularJS | 1.5.11 | End of life since January 2022 |
jQuery / Bootstrap | 1.12.4 / 3.3.7 | Old major lines |
Bower | n/a | Deprecated package manager |
You do not clone this specimen. You generate it, with AWS Transform custom itself.
The companion repository
aws-samples/sample-resources-for-transform-custom/java-modernisation holds a custom transformation definition, the generator, that builds the whole project: the three Maven modules, the six services, the end-of-life dependencies from the table above, the AngularJS front end, and the 69 tests. You publish the generator to your account's AWS Transform custom registry and run it, and the app it produces is the baseline every step below starts from.This means the first tool you use on the specimen is the same platform that modernises it later, and the legacy patterns are fixed by the generator rather than left to chance.
You need the AWS Transform CLI (
atx ) authenticated to an account with AWS Transform custom access, and git . Clone the repository and publish the generator from its source directory:git clone https://github.com/aws-samples/sample-resources-for-transform-custom.gitcd sample-resources-for-transform-custom
# publish the generator transformation definition to your account's registryatx custom def publish \ -n recreate-legacy-java-inventory-app \ --sd java-modernisation/legacy-java-app-generator \ --description "Recreates a deliberately legacy Jakarta EE 8 (javax) Inventory and Order Management EAR app for WildFly 18-26 as input for modernization exercises" \ --jsonpublish adds the generator to your account's AWS Transform custom registry and returns its details as JSON. Once published, it appears in atx custom def list and can be run by name, by you or by anyone on the account with the right permissions, and it does not expire the way a draft would.Then run it into an empty directory:
mkdir legacy-inventory-app && cd legacy-inventory-appgit init
atx custom def exec \ -n recreate-legacy-java-inventory-app \ -p . -x -tThe generator writes the first code into the repository and builds it, committing on its own staging branch. That branch is your baseline, and every step below starts from it. (
-x -t run it non-interactively with tools trusted.)The repository's README documents the generator and its options in full. The generated tree will vary in incidental detail such as class names, view markup, and seed data, because the generator authors the code; what matters, the module structure, the end-of-life dependencies, and the
javax.* namespace, is fixed by the generator.Start from a working baseline
The generator has already built the app, and its 69 JUnit 4 tests pass. Before starting any modernisation task with AWS Transform custom, deploy it and run it. The generated repository's README has the prerequisites (JDK 11, Maven, WildFly 18) and the deploy steps.
That running app and its test suite are your baseline. Modernisation is a behaviour-preserving exercise: the app should do after each step what it did before, so it helps to know what it does now while you still have the original in front of you. Those 69 tests travel with the code through the steps that follow, and watching what happens to them is one way each step shows its work.
The modernisation steps
Every step in this walkthrough uses an AWS-managed transformation : a pre-built, AWS-vetted transformation definition (prefixed
AWS/ ) that you run without writing one yourself. They come in two kinds: analysis transformations that read code and report findings, and remediation transformations that change it. Some are marked early access, which means they work but may change based on customer feedback. The walkthrough runs one analysis transformation, then three remediation transformations, each against the result of the previous step:Step | Transformation | Kind | Status |
|---|---|---|---|
1. Analyse the codebase | AWS/comprehensive-codebase-analysis | Analysis | Generally available |
2. Java 11 to Java 25 and Jakarta EE 10 | AWS/java-version-upgrade | Remediation | Generally available |
3. WildFly EAR to Spring Boot | AWS/JBoss-to-Spring-Boot | Remediation | Early access |
4. AngularJS 1.x to React | AWS/early-access-angular-to-react-migration | Remediation | Early access |
You run each one from the command line with
atx custom def exec . The run works in your repository but never commits to your current branch. It creates a staging branch named atx-result-staging-<conversation-id> from where you are and commits its work there as it goes: one commit per completed phase, authored by ATX Bot , with the build status in each message. When the run ends, your working tree stays on that branch, so the next step starts from it. The steps chain this way: each branch holds its step's result on top of everything before it, and the previous branch stays untouched as a snapshot. To review a step, diff its branch against the previous one; to back it out, check out the previous branch. There is nothing to merge. Each run also writes a git_instructions.md file under ~/.aws/atx/custom/<conversation-id>/artifacts/ , outside the repository, that suggests a squash merge or cherry-picking the commits; this walkthrough needs neither.Step 1: Analyse the codebase
Before changing anything, have AWS Transform custom tell you what it is looking at. The
AWS/comprehensive-codebase-analysis transformation reads the project and reports its findings without modifying a line of code:atx custom def exec \ -n AWS/comprehensive-codebase-analysis \ -p . -x -tThis is an analysis transformation, so it produces a report rather than a diff. Against the specimen it names the tech debt you would expect from the dependency table, now attributed to the code that carries it:
- Language and runtime. Java 11 as the build target, well behind the current LTS, and a Jakarta EE 8 backend on the
javax.*namespace that any move to Jakarta EE 9 or later must rename tojakarta.*.
- End-of-life dependencies. Log4j 1.2.17 (end of life since 2015), Jackson Databind 2.9.10 (known CVEs), Apache Commons HttpClient 3.1, standalone JAXB 2.3.0, Commons Lang 2.6, and JUnit 4.11.
- Front end. AngularJS 1.5.11 (end of life since January 2022), jQuery 1.x, Bootstrap 3, and Bower, a package manager that is itself deprecated.
- Application-server coupling. A three-module EAR packaged for WildFly and tied to it by EJB packaging and EE descriptors, which is architectural debt rather than a stale version number.
The findings above are the summary; the transformation writes the detail to an
ATXDocumentation/ folder in the project. Open it before moving on. It holds the generated analysis of the codebase, its structure, dependencies, and the tech debt the step found, and it is worth reading both as the evidence behind the summary and as documentation of an app whose original authors are long gone.None of this surprises on an app built to be legacy, and that is its use here: the analysis names the work before you commit to any of it, and each step that follows answers part of the list. On a real estate you do not already know by heart, this read-only pass is where a modernisation plan starts.
Step 2: Java 11 to Java 25 and Jakarta EE 10
Point the
AWS/java-version-upgrade transformation at the project. It upgrades the language, the namespace, and the dependencies in place, diffing against the baseline you committed:atx custom def exec \ -n AWS/java-version-upgrade \ -p . -x -t \ -c "mvn clean install" \ -g "additionalPlanContext='Upgrade to Java 25 and Jakarta EE 10'"-g takes comma-separated key=value pairs, so keep commas out of the additionalPlanContext text; if you need one, put the context in a JSON or YAML file and pass its path to -g instead.Your diff will touch a different set of files and lines, because the generator authors your specimen and each run plans its own changes. In the run behind this post, the transformation:
- Moved the build to Java 25 (
maven.compiler.release=25) and refreshed the Maven plugins.
- Migrated
javax.*tojakarta.*across entities, services, REST resources, and descriptors, targeting Jakarta EE 10 (jakartaee-api 10.0.0, EJB 4.0, EAR version 10).
- Updated the dependencies: moved each end-of-life library to its current supported line or replaced it with its modern successor (Log4j 2, commons-lang3, a current Jackson, a newer HttpClient, Jakarta XML Binding), and updated the test libraries with them.
- Updated the README for the new runtime.
- Documented its own deviations, for example choosing a current Jackson line rather than an older one that would have reintroduced fixed CVEs.
How you know it worked. The build command the run executes (
mvn clean install ) reports 69 of 69 tests passing. The code compiles against Jakarta EE 10 and Java 25, and the business logic the unit tests cover still behaves.Step 3: WildFly EAR to Spring Boot
The next finding is architectural: the backend can only run inside a managed WildFly instance, tied to it by EJB packaging,
ejb-jar.xml , a JTA data source, and an IronJacamar data source descriptor. The AWS-managed AWS/JBoss-to-Spring-Boot transformation (early access) addresses it. Run it the same way, against the result of Step 2:atx custom def exec \ -n AWS/JBoss-to-Spring-Boot \ -p . -x -t \ -c "mvn clean verify"Despite the name, its description covers WildFly, the upstream project of JBoss EAP.
This step is an architectural rewrite rather than an upgrade:
- The three-module EAR collapses into a single Spring Boot module with an
@SpringBootApplicationentry point and an embedded servlet container. The EE descriptors (ejb-jar.xml,beans.xml,persistence.xml,web.xml, the data source XML) are gone.
-
@StatelessEJBs become@Service @Transactionalbeans with constructor injection, and container JTA gives way to Spring's local transaction manager.
- JAX-RS becomes Spring MVC (
@RestController,@GetMapping,@PathVariable,ResponseEntity), with the/apiprefix preserved so the AngularJS front end keeps working unchanged.
- Data source and JPA configuration move to
application.ymlwith a HikariCP pool mirroring the old one, andopen-in-view: false.
- Logging moves to SLF4J and Logback. A multi-stage Dockerfile and Spring Boot Actuator (health, info, metrics, Kubernetes probes) are added.
- The AngularJS app moves to
src/main/resources/static/, Spring Boot's static-content convention.
A framework and application-server migration of this shape, EJB to Spring beans, JAX-RS to Spring MVC, descriptors to configuration, is the work that keeps modernisation projects off the roadmap. AWS Transform custom delivers it as one reviewable branch that preserves the API contract.
How you know it worked. The test suite moves to JUnit 5, keeps every original test, and adds Spring MockMvc integration tests and a context-load test;
mvn clean verify passes with zero failures. That is stronger than Step 2: the context-load test boots the real Spring application context, and the MockMvc tests drive the real controllers through the real request mapping and serialisation. MockMvc still exercises the web layer without a running server or a browser, so add the end-to-end check yourself. The app no longer needs WildFly. Start the packaged jar on its embedded server:java -jar target/inventory-management.jarThen open
http://localhost:8080/inventory-web in a browser and check the AngularJS screens against the baseline you tested at the start.Step 4: AngularJS 1.x to React
The last finding is the front end: an AngularJS 1.5 single-page app on end-of-life libraries. The AWS-managed
AWS/early-access-angular-to-react-migration transformation (early access) migrates it to React. Run it the same way, against the result of Step 3:atx custom def exec \ -n AWS/early-access-angular-to-react-migration \ -p . -x -t \ -g "additionalPlanContext='Migrate the AngularJS 1.5 SPA in src/main/resources/static to React'"Behaviour first, code second
In the run behind this post, the transformation built the instrument it would be judged by before writing any React:
- A stateful mock backend. An Express server reproducing every
/apiendpoint, so the front end could be exercised in isolation.
- Characterisation tests. A Playwright suite capturing what the AngularJS app does today, with istanbul coverage.
- A split between behaviour and DOM. It restructured those behaviours into a framework-agnostic
scenarios/layer containing no selectors at all, and a Page Object Model (pom/) that holds every piece of DOM knowledge.
- A visual baseline. A 1440×900 screenshot of every route in the AngularJS app.
Only then did it generate the React app: React 18 with strict TypeScript, Vite, React Router v6, TanStack Query, and React Hook Form, keeping Bootstrap 3's CSS for visual parity and dropping jQuery. To verify, it wrote a React Page Object Model and ran the same scenarios, byte-identical, against the new app, then screenshotted every route again and diffed the images.
This split between behaviour and DOM is what makes the result trustworthy. When the scenarios are rewritten for the new framework, a passing suite says the new tests agree with the new code. When the scenarios do not change and only the page objects are swapped, a passing suite says the new app does what the old app did. The second is a much stronger claim, and it is the one a migration needs.
Results
Exit criterion | Result |
|---|---|
npm run build with zero errors | Pass ( tsc --noEmit and vite build ) |
Business behaviour preserved | Pass: every unchanged scenario passes against React |
Visual difference at or below 30% of pixels per route | Pass: every route, well under the threshold |
No Angular packages remain | Pass |
The visual results land far inside the threshold. One reason shows up in the generated code. The transformation reimplemented AngularJS's
currency and date:'short' filters to produce byte-identical en-US output, so numbers and dates render exactly as before.Reading the generated source confirmed the numbers. It is idiomatic React: clean layering (
api/ , services/ , features/ , shared/ ), an http.ts that reproduces $http semantics, TanStack Query with proper query keys and optimistic cache updates, React Hook Form with useFieldArray for order line items, and strict TypeScript with well-modelled domain types. The defects were minor, and the transformation flagged them itself: a few stray ng-if attributes left on JSX elements (harmless, removed in review), and one deliberate ng-view attribute correctly kept because the CSS and the test selectors depend on it.With the front end migrated, every entry in the specimen's dependency table has been replaced or removed. The table below compares the specimen with the result of Step 4:
Library | Specimen | After Step 4 | Changed in |
|---|---|---|---|
Java | 11 | 25 | Step 2 |
Java EE / Jakarta EE | Java EE 8 ( javax.* ) | Jakarta EE 10 ( jakarta.* ) | Step 2 |
Application server | WildFly 18 (EAR) | Spring Boot 3.5.16 with embedded Tomcat 10.1.55 | Step 3 |
Log4j | 1.2.17 | Log4j 2.25.5 | Step 2 |
Apache Commons Lang | 2.6 | commons-lang3 3.18.0 | Step 2 |
Jackson Databind | 2.9.10 | 2.21.7 | Steps 2 and 3 |
Apache Commons HttpClient | 3.1 | Apache HttpClient 5.6.3 | Step 2 |
JAXB RI ( javax.xml.bind ) | 2.3.0 | Jakarta XML Binding 4.0.5 (runtime 4.0.9) | Steps 2 and 3 |
H2 | 1.4.197 | 2.3.232 | Step 2 |
JUnit | 4.11 | JUnit 5.12.2 (Jupiter) | Steps 2 and 3 |
Mockito | 3.12.4 | 5.24.0 | Step 2 |
AngularJS | 1.5.11 | React 18.3.1 with TypeScript 5.7.2 | Step 4 |
jQuery / Bootstrap | 1.12.4 / 3.3.7 | Removed; the Bootstrap 3 styles the app uses are kept as plain CSS | Step 4 |
Bower | n/a | Removed; npm with Vite 6.0.7 | Step 4 |
These are the versions from one set of runs. Each run plans its own changes and picks the current releases at the time, so your versions, and the step that changes each library, may differ.
How you know it worked. The React app does what the AngularJS app did, across every user-level behaviour the suite captures, and looks the same on every route, measured rather than eyeballed. One caveat to read honestly: branch coverage is not comparable across the two apps. istanbul cannot instrument
ng-if and ng-show template expressions, so the AngularJS baseline measures only a small set of branches and looks higher than it is. The React side exposes far more branch structure, so the same scenarios cover a lower share of it. The suite's coverage gate is advisory, not an exit criterion. The scenarios ran against the mock backend. To see the React front end working with the Spring Boot service from Step 3, start the backend as in Step 3:java -jar target/inventory-management.jarThen, in a second terminal, start the front end from the React project's directory,
src/main/frontend , and point it at the backend:cd src/main/frontendAPI_TARGET=http://localhost:8080 npm run devOpen
http://localhost:5173/inventory-web in a browser and browse the migrated pages.What it cost
Agent minutes, the AWS Transform custom billing unit, measure active agent work, not wall-clock time. The table lists every run behind this post, from generating the specimen to the React migration. Your runs will report different figures.
Step | Transformation | Wall clock (min) | Agent minutes | Result |
|---|---|---|---|---|
0. Generate the specimen | recreate-legacy-java-inventory-app | 24 | 200.4 | All exit criteria passed; 93 files |
1. Analyse the codebase | AWS/comprehensive-codebase-analysis | 33 | 177.5 | All exit criteria passed; 31 documentation files |
2. Java 11 to Java 25 and Jakarta EE 10 | AWS/java-version-upgrade | 15 | 87.2 | All exit criteria passed; 53 files |
3. WildFly EAR to Spring Boot | AWS/JBoss-to-Spring-Boot | 31 | 238.1 | All exit criteria passed except web UI navigation, which needs a browser the run environment did not have (you check it in Step 3); 103 files |
4. AngularJS 1.x to React | AWS/early-access-angular-to-react-migration | 106 | 550.5 | All 4 exit criteria passed; 139 files |
Total | | 209 | 1,253.7 | |
To learn more on how to attribute AWS Transform custom spend to each run with Amazon CloudWatch, you can see this other blog post What did that transformation cost? .
How each step was verified
Each step, from generating the specimen to migrating the front end, proves a different amount about the app. Seeing the verification side by side shows where to add your own checks:
Step | Transformation | How it was verified | What to add yourself |
|---|---|---|---|
Generate the specimen | recreate-legacy-java-inventory-app | 69 JUnit 4 tests in the generator's build | Deploy to WildFly 18 and test the app |
Java 11 to 25, Jakarta EE 10 | AWS/java-version-upgrade | 69 inherited unit tests | Run mvn clean test |
EAR to Spring Boot | AWS/JBoss-to-Spring-Boot | Original tests on JUnit 5, plus MockMvc and context-load tests | Start the jar and check the screens against it |
AngularJS to React | AWS/early-access-angular-to-react-migration | Unchanged behavioural scenarios and per-route pixel diffs | Optional: browse the migrated pages against the Spring Boot backend |
A transformation's verification is as strong as the tests it inherits or builds. The Java upgrade validates against the unit suite it inherits, so re-running that suite on your machine confirms the logic holds. The Spring Boot step adds integration tests but stops short of a running server, so start the jar and check the screens against the baseline you tested at the start. The front-end step builds a behavioural oracle before it writes any new code, so it proves on its own that the React app does what the AngularJS app did. Its scenarios run against a mock backend, so browsing the app against Spring Boot is where you see the two together.
Practical notes
A few things that cost time and need not cost yours:
- Sequence the steps. Each step starts from the result of the previous one, so the order matters: language and platform version first, then the application server, then the front end.
- Read transformation descriptions, not just names. "JBoss to Spring Boot" covers WildFly. "Angular to React" accepts AngularJS 1.x. Both accept more than their names suggest.
- Run custom transformations in a git repository. AWS Transform custom works on branches and diffs against what is already committed. For the generator, an empty
git initrepository is enough; every later step starts from the branch the previous run left.
- Keep every step's branch. Each one is a snapshot you can diff against or return to, and its
ATX Botcommits stay intact, sogit log --author="ATX Bot"shows exactly what each transformation did.
Limitations
A step's verification goes only as far as the tests the transformation inherits or builds. "How each step was verified" lists what each step leaves for you to check: re-run the tests, start the app and use it, or both, depending on what the step changed.
AWS/JBoss-to-Spring-Boot and AWS/early-access-angular-to-react-migration are early-access transformations, so their scope and phases may change. Review their output before you build the next step on it, as you would for any transformation.This walkthrough modernises one specimen of about 5,000 lines and reports one run of each transformation, so treat it as an example, not a benchmark. You can apply the same steps to your own applications, but expect different file counts, test results, and agent minutes.
Conclusion
In this post, you took a deliberately legacy Java EE application to Java 25, Spring Boot, and React with AWS Transform custom. A read-only analysis named the work first, then three AWS-managed transformations did it, each one leaving a branch you review before the next step builds on it, and each one idiomatic enough to pass a careful read. The hand-written version of this project, reading every class and preserving every behaviour, is the one enterprises keep postponing. Here it was three sequenced transformations and a review at each step.
Keep one habit from this walkthrough: capture how the app behaves before you start, and check that behaviour again after each step. The test suite, which each step runs and extends, confirms the logic; starting the app and using it confirms that it runs end to end. Use whichever fits what the step changed, or both. AWS Transform custom modernises the app, and comparing each step with your baseline shows that the app still works.
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article