Loosing endless time due to compilation of multimodule project (maven)
Hello everyone,
there is something which wastes me countless hours each day and is getting me insane bat shit mad. It literally wastes my life.
In the company I'm working for, most of our projects are maven multi module projects. The way it works with maven is, that these modules get installed into the local .m2 folder and then these modules are retrieved for other depended modules (from the same project).
Suppose we have project with the following 4 modules:
Parent Module:
- Bom Module
- Data Module (Depends on BOM Module)
- Server Module (Depends on BOM and Data Module)
Now when I want to run a unit test in inteliji which resides in the server-module, after I have fixed a bug in the data-module I need to do the following:
* maven: parent clean
* maven install bom (only if something has changed there)
* maven: parent install
* refresh maven modules within intelijii via the maven explorer
* run the unit/integration test again
Really this takes too long! I have to recompile the entire project every time I change something. Also when I forget something like running clean or executing refresh in intelijii, I break my head why things are not working as expected.
Same issue I have when I need to troubleshoot why some file from the classpath is not getting picked up or for instance some configuration change was not applied. You often end up searching , but you waste time because things just failed cause the dependencies within intelijii where not updated or refreshed but when you not aware of that you look in the wrong direction. So especially in troubleshooting scenarios this is highly unproductive and confusing.
I also noticed that when I debug the other modules from the same project, it only shows me the dissambled source code. I know that there is an option to just recompile a single java file, but I reckon in this multi module environment it is not really working for me.
This whole think makes me mad, as it completely breaks the flow of my work since have to wait way too much. However I can not change the project structure now. Shouldn't it be as easy as just recompiling a java class and then rerunning the test?
What needs to be done to get it to work better?
Please sign in to leave a comment.
For the changes be picked up by IDE without need to re-publish project to local repository and do a Maven Reload action in Maven tool window, the dependencies on these modules must be configured on the IDE module itself instead of the .jar in the local Maven repository. For the IDE to configure dependencies this way the following requirements should be met:
Then IDE will automatically configures dependencies on modules instead of local jar files when you do a Maven Reload.