[MAVEN_INCREMENTAL_BUILD-12] Plugin looks for a resources directory in POM modules where it is not necessary Created: 25/Jul/11 Updated: 06/Mar/12 Resolved: 27/Jan/12
|Remaining Estimate:||Not Specified|
|Time Spent:||Not Specified|
|Original Estimate:||Not Specified|
Ubuntu 11.04, Maven 2.2.1
I am running Maven Incremental Build on a multi-module project. The parent module does not have a src/resources or src/java directory because it is a POM module.
When the plugin executes, it says that src/resources is not found also also states that a resource has been deleted, and therefore it cleans the parent module, which leads to a full build instead of an incremental build.
Output from Plugin :
|Comment by mrleit [ 26/Jan/12 ]|
I was looking at this same problem, and because it was occurring at the top level of our hierarchy it caused the entire structure to rebuild.
I checked out trunk and I believe I isolated and fixed the problem, which was that the resourcesList file was never created due to an incorrect logic statement.
In IncrementalBuildMojo.java in resourcesUpdated() at the end...
where it checks that previousResources is empty. I believe it should be checking that it is not empty !isEmpty(). PreviousResources is the list of resources - (minus) the current files in the resource directory. If anything is left in this list, then something was deleted.
After this is fixed, the method correctly writes the actual resources file.
This also causes the resource unit test to fail... and I believe it never worked properly anyway.
I've Ignored it for now.
Behaviour of the plugin appears to be as expected now.
|Comment by mrleit [ 06/Mar/12 ]|
I have been testing the 1.6 release and have noted that there seems to still be a slight issue with testResource directory.
The project is being cleaned in much the same way as previously because of the src/resource directory, however this time it is caused by test/resource.
Here is the log illustrating the problem.
I have manually added an empty resource directory to test folder to workaround this issue. But we have dozens of projects that don't have and don't require this directory.