Closed harschware closed 7 years ago
I think this is a critical bug. The issue is that the update-file-header repo doesn't re-apply headers in all cases (I tested changing the organization/name element in the parent pom). The remove-file-header goal will work for some portion of the files and the fail with the exception. Subsequent runs produce the exception without making through any additional headers, so you can't just run it a few times to remove all headers as a work around.
The problem appears to be that it attempts to search past the beginning of the file. To fix, replace lines 476 with:
try {
lastchar = content.charAt((--firstIndex));
} catch ( StringIndexOutOfBoundsException s ) {
firstIndex = 0;
break;
}
For some reason I get index out of bounds exception from plugin. Let me know if there is any additional info I can provdie.
The error came from running
mvn license:remove-file-header
immediately after successfully runningmvn license:update-file-header
which changed 27 of my source files. The remove-file-header goal does not remove the header previously applied.