In maven lifecycle enhancement of code in src/main occurs in process-classes phase which is a lifecycle phase after compile. Similarly, enhancement of src/test code occurs in process-test-classes phase which is after test-compile.
If we run:
mvn clean process-classes
... lots of stuff ...
...
[INFO] --- maven-compiler-plugin:3.10.1:compile (default-compile) @ my-project ---
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!
[INFO] Compiling 44 source files to /home/rob/github/eroad/consolidation/backport/target/classes
[INFO]
[INFO] --- ebean-maven-plugin:13.6.5:enhance (main) @ my-project ---
[INFO] classSource=<redact>/target/classes transformArgs=debug=0
[INFO] packages entity:[<redact>] transactional:[] querybean:[] profileLocation:true version:141
[INFO] loaded resources: [META-INF/ebean-version.mf, META-INF/ebean-generated-info.mf]
[INFO] Entities (14) pkgs[<redact>...
[INFO] QueryBeans (14) pkgs[<redact> ...
[INFO] Transactional (1) pkgs[<redact> ...
[INFO] Query Callers (4) pkgs[<redact> ...
We see the enhancement happening after compile, in the process-classes phase.
Similarly,
mvn clean process-test-classes
... lots of stuff ...
...
[INFO] --- maven-compiler-plugin:3.10.1:testCompile (default-testCompile) @ my-project ---
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!
[INFO] Compiling 17 source files to /home/rob/github/eroad/consolidation/backport/target/test-classes
[INFO]
[INFO] --- ebean-maven-plugin:13.6.5:testEnhance (test) @ my-project ---
[INFO] classSource=/home/rob/github/eroad/consolidation/backport/target/test-classes transformArgs=debug=0
[INFO] packages entity:[nz.co.eroad.backport.consolidation.domain, nz.co.eroad.backport.domain, nz.co.eroad.backport.central.domain] transactional:[] querybean:[] profileLocation:true version:141
[INFO] loaded resources: [META-INF/ebean-version.mf, META-INF/ebean-generated-info.mf]
[INFO] Entities (0) pkgs[] beans[]
[INFO] QueryBeans (0) pkgs[] beans[]
[INFO] Transactional (0) pkgs[] beans[]
[INFO] Query Callers (2) pkgs[<redact> ...
So before mvn exec:java ... we just need to confirm that the process-classes phase has actually been run.
Cheers, Rob.