Closed muffl0n closed 10 years ago
Followup to #206
The exception is thrown if the resource is invalid. E.g. if it can't be read or does not exist. The plugin should then obey the setting the user made for "ignoreMissingResources". While deploying our webapp to our production servers we wan't to make sure that there is none of the configured resources missing. The maven build should fail an so should the whole job in Jenkins. This PR enables us to do so. It gives the setting " ignoreMissingResources" back it's meaning.
In other words: what IOException could occure that is only fatal to the change detection but not to the rest of the plugins execution? If scanning for changes fails, all other operations in this file will most likely fail, too.
If there is a missing resource, the build should obey the "ignoreMissingResources" meaning. But, the exception will be thrown during processing. There is no need to duplicate this check in resource change detection.
In other words: what IOException could occure that is only fatal to the change detection but not to the rest of the plugins execution?
I agree with that statement. The only thing that bothers me, is duplicate check for 'ignoreMissingResources' (here and in processor exception handling).
I agree that the check for ignoreMissingResources should not be duplicated. I will see if I can check why it didn't work for me in the first place tomorrow at the office.
That's weird. I can't reproduce the false positive I got yesterday. It didn't matter if I set ignoreMissingResources to false, the build did not break as intended. So I created this PR which should just be ignored now.
Sorry for the inconvenience.
It is not excluded that there is a bug hiding somewhere... There is nothing wrong with this PR. I could merge it... the only thing missing, is an unit test proving it works as intended.
If there really is a bug somewhere I prefer to hunt that one instead to patch the problem at another position. I will try to reproduce this bug and see if I can fix it.
@muffl0n sound reasonable. Thanks!
Somehow the incrementalBuilding-Feature broke the behaviour that ignoreMissingResource should provide. This PR throws a MojoExecutionException if a resource is invalid and ignoreMissingResource is set to false.