|
+1 for the forceCompile option
I'm testing using AspectJ to enforce development contracts at compile-time. The idea is to have compilation fail if architectural patterns are violated (e.g calling a method from the wrong layer, etc.). This works fine the first time, but when building a second time in a row, the plugin doesn't invoke the ajc compiler because neither sources nor configuration have changed. Therefore the project can be built, in spite of contract violation. This is not exactly the same case as Ken, as I get the message "No modifications found skipping aspectJ compile". For whatever it's worth, I'm attaching a (very simple) patch to solve my problem. I've tried to handle Ken's case as well (forcing compilation even if no sources are found), but then the ajc compiler complains that no sources were specified. I've not tried his exact situation though (external jar with external aspects). Please note that I've had problems running the tests : some fail from CLI, but they work from Eclipse (except AjcReportMojoTest, but it also fails without my changes). Adds a 'forceAjcCompile' to force ajc compilation even if no sources have been modified and the ajc options haven't changed.
good.. will apply the patch one of the following days, but need to add some stuff on it to make it work as we want (from the cli e.g.)
|
|||||||||||||||||||||||||||||||||||||||||||||||
There would be difficult for me figuring out if something has changed in the aspect library or in the jar to weave for that sake, but when you mention it this could also explain some strange behaviour in my own project, forcing me to do a clean install sometimes
But one thought come to mind, would it be ok with a forceCompile flag to be set eighter from the CLI or the pom ?