IntelliJ IDEA Plugin
Ebean uses bytecode enhancement to provide
dirty checking and
Install Ebean's IntelliJ plugin such that entity beans and transactional methods are enhanced
when run develop and run tests in the IDE.
Install the Plugin
File > Settings > Plugins > "ebean"
Install Ebean IDEA Plugin
Turn plugin on per project
The plugin is turned on and off per project. We need to turn it on for it to perform enhancement on the current project.
To confirm things are working properly we check that the
is marked as Generated Sources Root. If this directory isn't recognised by the IDE as a generated
sources root then we won't be able to import and use query beans and the IDE will give compiler errors -
unknown type for the query beans.
Generated Sources Root
target/generated-sources/annotations directory is marked as Generated Sources
Manually mark Generated Sources Root
If IntelliJ has not automatically marked the directory as Generated Sources we can manually do so:
Right Mouse - Mark Directory as - Generated Sources Root
What this plugin does is adds
ebean-agent.jar as a
javaagent to the command
line when IDEA runs tests or main methods for the project. In the IDEA console we can click on the
the command line to expand it showing us the full command line used including the
command line option specifying the ebean agent.
The very first line of output in the IDEA console is by default truncated with
.... Click on
this first line expands to show the entire command line used.
Click on the command line
Clicking on the first line of the output expands to show the full command line used to run tests/main methods.
In the command line we see the
-jaavagent argument specifying the ebean agent
used for enhancement.