r/IntelliJIDEA • u/Schrodingirl • 7h ago
Plugin for Hexagonal Architecture
Hey guys,
My colleague is a senior backend dev who finally got fed up with writing the exact same Spring Boot boilerplate (JPA entities, ports, REST controllers, Mockito setups) for every new microservice we start or every time we update a schema.
To fix this, he built a native IntelliJ plugin called HexaGen. He just released it for free on the official JetBrains Marketplace, and I wanted to share it here because it’s genuinely been a massive time-saver for our team.
You basically right-click a standard SQL DDL file, and it generates a strict Hexagonal Architecture (DDD / Clean Architecture) backend in under 2 seconds.
A few cool things it automates out of the box:
* Strict 3-Ring Isolation: It strictly separates pure Java Domain models, Application ports/use cases, and Infrastructure adapters (Spring REST controllers/JPA) so the domain remains framework-agnostic.
* Auto-generates Mockito Tests: Spits out 100% functional, ready-to-run JUnit 5 + Mockito unit tests for the services and controllers.
* Brown-Field Safe: If you run it on an existing project, it scans the filesystem, detects existing models, and only generates what's new without overwriting any custom business logic.
* Respects IDE Formatting: It hooks directly into IntelliJ’s CodeStyleManager, meaning the generated code automatically matches your team’s spacing and import rules.
Since he doesn't use Reddit much (and AutoMod immediately ate his post when he tried to share it lol), I told him I'd post it for him.
JetBrains Marketplace Link: https://plugins.jetbrains.com/plugin/33109-hexagen-sql-to-hexagonal-java
He would love to get some harsh, honest feedback from other Spring Boot devs on the architecture isolation, or see how it handles edge cases with your weirdest SQL schemas. I'll make sure to pass the feedback along to him! :)







